0
How will you print 10 random numbers using forEach of java 8

Open 1 Answers 71 Views Education
How will you print 10 random numbers using forEach of java 8 ?

1 Answer

0

How will you print 10 random numbers using forEach of java 8 in Java8?

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

Random random = new Random();

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

by (54.6k points)
...