Write a program that generates 100 random integers between 0 and 9 and displays the count for each number. (Hint: Use an array of ten integers, say counts, to store the counts for the number of 0s, 1s, . . . , 9s.)

Breaking it down

This example will use java 8 to generate random numbers within a range and then group each number using Collectors.groupingBy and Collectors.counting() to count the number of times a digits is chosen.