Write a program to generate three single-digit integers and prompt the user to enter the sum of these three integers.
Breaking it down
Initializing a Random class and calling ints will create an infinite stream of values between the range of 0 and 9 per requirements. Stream.limit() will stop the stream at three elements and we will convert the stream to a list. To show the answer to the user we will want to reduce the stream or calculate the sum of the values. Next to pretty up the output, we will join all the elements and separated by a space by passing in Collectors.joining(). Finally we will ask the user for their answer and validate if they have the right answer by comparing values.