Page 1 of 1

About Question enthuware.ocpjp.v8.2.1810 :

Posted: Sun Jul 07, 2019 3:13 am
by Perelun
In the explanation: the phrase " Finally, the average() method computes the average of all the elements, which is 0.0. " is negated by "Since the stream contains no element and the average() method returns an OptionalDouble containing OptionalDouble.empty".

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

Posted: Sun Jul 07, 2019 10:36 am
by admin
Actually, the exact sentence used in the explanation is, "Finally, the average() method tries to compute the average of all the elements." This is what the code, as written, is meant to do. However, as the explanation further notes, something else happens.