Issue
Example:
System.out.println("----flatMapToInt----");
Stream<List<Integer>> list = Stream.of(
Arrays.asList(1,2,3,4),
Arrays.asList(10,20,30,40)
);
IntSteam list2 = list.flatMapToInt(...);
How to achieve it using Java 8 or Java 11?
Solution
you can do like this: IntStream intStream = list.flatMapToInt(l -> l.stream().mapToInt(i -> i));
Answered By - Ozay Duman
Answer Checked By - Timothy Miller (JavaFixing Admin)