in Education by (55.8k points)

How will you print 10 random numbers in Java 8?

1 Answer

0 votes
by (55.8k points)

How will you print 10 random numbers in Java 8?

The following code segment shows how to print 10 random numbers.

Random random = new Random();

random.ints().limit(10).forEach(System.out::println);

...