About Question enthuware.ocpjp.ii.v11.2.3333 :
Posted: Wed Dec 30, 2020 9:44 am
I think this option is not correct not only because of lack of getAsDouble() call:
also parallelStream() is not correct for Stream. I guess this shall be
Code: Select all
double average = nums.parallelStream().mapToInt(i->i).average();
Code: Select all
double average = nums.parallel().mapToInt(i->i).average().getAsDouble();