0 votes
7 views
How will you print 10 random numbers using forEach of java 8 ?
in Education by (49.4k points)

1 Answer

0 votes

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 (49.4k points)

Related questions

0 votes
1 answer 11 views
0 votes
1 answer 8 views
0 votes
1 answer 21 views
0 votes
1 answer 15 views
0 votes
1 answer 13 views
0 votes
1 answer 16 views
0 votes
1 answer 14 views
0 votes
1 answer 12 views
0 votes
1 answer 10 views
...