The Stream API (Java 8+) enables functional-style processing of collections — filtering, transforming, and aggregating data through a pipeline of operations, expressed declaratively (what to do) rather than with explicit loops (how).
Imperative vs Stream style
List<String> result = <>();
(Person p : people) {
(p.getAge() >= ) {
result.add(p.getName().toUpperCase());
}
}
List<String> result = people.stream()
.filter(p -> p.getAge() >= )
.map(p -> p.getName().toUpperCase())
.collect(Collectors.toList());
