Java.lang Class - Programming

Q1:

Which statement is true given the following? Double d = Math.random();

A 0.0 < d <= 1.0

B 0.0 <= d < 1.0

C Compilation fail

D Cannot say.

ANS:B - 0.0 <= d < 1.0

The Math.random() method returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0