Stream API (Java 8+), koleksiyonların fonksiyonel tarzda işlenmesini sağlar — verinin filtrelenmesi, dönüştürülmesi ve toplandığı bir işlem hattı aracılığıyla, açık döngüler (nasıl) yerine bildirimsel olarak ifade edilen (ne yapacak).
Zorunlu vs Stream stili
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());
