Question 6
Consider the Java code given below.
import java.util.*;public class Sample { public static void main(String[] args) { List<Integer> numbers = Arrays.asList(10, 20, 25, 15, 5, 30, 35); numbers.stream() .takeWhile(n -> n % 2 == 0) .forEach(n -> System.out.print(n + " ")); System.out.println(); numbers.stream() .dropWhile(n -> n % 2 == 0) .forEach(n -> System.out.print(n + " ")); }}What will the output be?
10 20 25
15 5 30 3510 20
25 15 5 30 3510 20 25
15 5 3010 20 25 15 5 30 35