1.

How Will You Print 10 Random Numbers In Java 8?

Answer»

The FOLLOWING code segment shows how to print 10 RANDOM NUMBERS.

Random random = new Random();
random.ints().LIMIT(10).forEach(System.out::println);

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

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



Discussion

No Comment Found