The answer says reduce() and max().
Actually there are three answers right?
reduce()
max()
sum()
Why is sum() not included as the correct answer?
About Question enthuware.ocpjp.v8.2.1738 :
Moderator: admin
-
- Posts: 5
- Joined: Mon Jan 14, 2019 11:16 pm
- Contact:
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1738 :
The following explanation is already given with this option:
This is a valid reduction operation but it is not in java.util.stream.Stream interface.
Methods to sum up the numbers in a stream are available in specialized Stream interfaces such an IntStream, LongStream, and DoubleStream.
If you like our products and services, please help us by posting your review here.
-
- Posts: 33
- Joined: Sat Feb 15, 2020 12:44 am
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1738 :
This explanation does not show up in my review of the (wrongly) answered question. It just shows an explanation for "add": "There is no such method in Stream interface." Maybe this message is also related to "sum", but it just shows under "add".admin wrote: ↑Fri Jan 25, 2019 10:29 pmThe following explanation is already given with this option:This is a valid reduction operation but it is not in java.util.stream.Stream interface.
Methods to sum up the numbers in a stream are available in specialized Stream interfaces such an IntStream, LongStream, and DoubleStream.
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1738 :
Please check your private message/email.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 36 guests