1.

What is the range of numbers returned by Math.random() method?(a) -1.0 to 1.0(b) -1 to 1(c) 0 to 100(d) 0.0 to 1.0I have been asked this question in semester exam.The question is from Random Number topic in section java.util – More Utility Classes of Java

Answer»

Right option is (d) 0.0 to 1.0

Explanation: Math.random() returns only DOUBLE VALUE greater than or EQUAL to 0.0 and LESS than 1.0.



Discussion

No Comment Found

Related InterviewSolutions