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

Open 1 Answers 40 Views Education

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

1 Answer

0

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