The explanation contains the following:
This is a valid reduction operation but it is not in java.util.stream.Stream interface. min and max methods are available in specialized Stream interfaces such an IntStream, LongStream, and DoubleStream.
The method 'max' is available in the Stream interface, only it takes a Comparator as an argument. The API says:
Optional<T> max(Comparator<? super T> comparator)
Returns the maximum element of this stream according to the provided Comparator. This is a special case of a reduction.
So I would argue that both 'reduce' and 'max' should be selected as the answer!
About Question enthuware.ocpjp.v8.2.1738 :
Moderators: Site Manager, fjwalraven
-
- Posts: 32
- Joined: Tue Oct 06, 2015 9:06 am
- Contact:
-
- Site Admin
- Posts: 10389
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1738 :
You are correct. Fixed.
thank you for your feedback!
thank you for your feedback!
-
- Posts: 15
- Joined: Fri May 15, 2015 12:06 am
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1738 :
Good question, really clarified with a reduction operation is for me. 

Who is online
Users browsing this forum: Bing [Bot] and 2 guests