0 votes
11 views

How will you print 10 random numbers in a sorted order in Java 8?

in Education by (49.4k points)

1 Answer

0 votes

How will you print 10 random numbers in a sorted order in Java 8?

The following code segment shows how to print 10 random numbers in a sorted order.

Random random = new Random();

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

by (49.4k points)

Related questions

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