About Question enthuware.ocpjp.v8.2.1793 :
Posted: Sat Jul 01, 2017 12:55 pm
type in explanation of variant 'ls.stream().reduce((a, b)->a>b?a:b)':
In the question body there is List<Integer> ls = Arrays.asList(10, 47, 33, 23);
Not 9, but 47.Therefore, it will return Optional object containing Integer 9 instead of just Integer 9 and you cannot assign an object of class Optional to a variable of type int.
In the question body there is List<Integer> ls = Arrays.asList(10, 47, 33, 23);