Page 1 of 1

About Question enthuware.ocpjp.ii.v11.2.3333 :

Posted: Wed Dec 30, 2020 9:44 am
by sirtomash
I think this option is not correct not only because of lack of getAsDouble() call:

Code: Select all

 
double average = nums.parallelStream().mapToInt(i->i).average();
also parallelStream() is not correct for Stream. I guess this shall be

Code: Select all

double average = nums.parallel().mapToInt(i->i).average().getAsDouble();

Re: About Question enthuware.ocpjp.ii.v11.2.3333 :

Posted: Wed Dec 30, 2020 10:08 am
by admin
I see that it has already been changed to parallel. Which question bank are you using?

Re: About Question enthuware.ocpjp.ii.v11.2.3333 :

Posted: Sun Jan 10, 2021 10:42 am
by teodorj
double average = nums.parallelStream().mapToInt(i->i).average();

In 817, it is not changed to parallel()
question bank version 1/21

Re: About Question enthuware.ocpjp.ii.v11.2.3333 :

Posted: Sun Jan 10, 2021 11:14 pm
by admin
Oh, you mean in the wrong option.
Explanation has now been added to include this point as well.
thank you for your feedback!