September 2019
Intermediate to advanced
816 pages
18h 47m
English
How about computing the average weight of a melon?
For this, we have Collectors.averagingInt(), averagingLong(), and averagingDouble():
double avgWeights = melons.stream() .collect(Collectors.averagingInt(Melon::getWeight));
Read now
Unlock full access