February 2014
Beginner
1248 pages
62h 25m
English
We summarize the roll frequencies in this example by collecting them into a Map<Integer, Long> in which each Integer key is a side of the die and each Long value is the frequency of that side. Unfortunately, Java does not allow primitive values in collections, so to summarize the results in a Map, we must first convert the IntStream to a Stream<Integer>. We do this by calling IntStream method boxed.
Read now
Unlock full access