Java: using stream api
Example:
List numbers = Arrays.asList(1, 2, 3, 4, 5);
Java Stream API provides a way to process sequences of elements.
Solution:
List squared = numbers.stream().map(x -> x * x).collect(Collectors.toList());
Example: Solution:Java: using stream api
Java Stream API provides a way to process sequences of elements.
List
List