Page 1 of 1

About Question enthuware.ocpjp.v8.2.1810 :

Posted: Fri Jan 26, 2018 12:37 am
by jorgeruiz
I think the last phrase in the 1st fragment of the explanation is incorrect:
Finally, the average() method computes the average of all the elements, which is 0.0.
It can't be 0.0 since there is no elements in the stream to get an average, hence the Optional is empty.
The second fragment correct this:
...the average() method returns an OptionalDouble containing OptionalDouble.empty
But still, I think the first fragment should be corrected to not cause misunderstandings.

Re: About Question enthuware.ocpjp.v8.2.1810 :

Posted: Fri Jan 26, 2018 1:14 am
by admin
I see your point. Updated.
thank you for your feedback!
Paul.