Java8 – What will happen when the code snippet given below is compiled and executed…


What will happen when the code snippet given below is compiled and executed?

1. List list = Arrays.asList(2, 4, 6, 7, 8);
2. boolean allEven = list.stream().allMatch( i -> {
3. System.out.print(i);
4. return i%2 == 0;
5. });

 

Related Posts

Close Bitnami banner
Bitnami