Question: Assuming that random is a SecureRandom object, explain in detail the stream pipeline: random.ints(1000000, 1, 3) .boxed() .collect(Collectors.groupingBy(Function.identity(), Collectors.counting())) .forEach((side, frequency) -> System.out.printf(%-6d%d%n, side, frequency));
Assuming that random is a SecureRandom object, explain in detail the stream pipeline:
random.ints(1000000, 1, 3)
.boxed()
.collect(Collectors.groupingBy(Function.identity(),
Collectors.counting()))
.forEach((side, frequency) ->
System.out.printf("%-6d%d%n", side, frequency));
Step by Step Solution
3.34 Rating (160 Votes )
There are 3 Steps involved in it
The call to method ints creates an IntStream of 1000000 int values of either 1 or 2 ... View full answer
Get step-by-step solutions from verified subject matter experts
