Q. What is the output of System.out.println(Math.random());?

B
A random double between 0.0 and 1.0 (exclusive)
C
1
D
-1
Solution:

Math.random() generates a random double greater than or equal to 0.0 and less than 1.0.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!