xxxxxxxxxx
import java.util.Arrays;
import java.util.List;
public class StreamExample {
public static void main(String[] args) {
List<String> fruits = Arrays.asList("apple", "banana", "cherry", "date", "elderberry");
// Filter fruits that start with 'c', then convert to uppercase, and print each result.
fruits.stream()
.filter(fruit -> fruit.startsWith("c"))
.map(String::toUpperCase)
.forEach(System.out::println);
}
}