Java Programming - Java.lang Class - Discussion

Discussion Forum : Java.lang Class - Pointing out the correct statements (Q.No. 1)
1.

Which statement is true given the following?

Double d = Math.random();

0.0 < d <= 1.0
0.0 <= d < 1.0
Compilation fail
Cannot say.
Answer: Option
Explanation:

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

Discussion:
2 comments Page 1 of 1.

N@W@Z said:   1 decade ago
In that above statement it should be:

double d = Math.random.

Keyword must be in small case that is why compilation error occurs.

Niriksha said:   9 years ago
What are the default ranges for all datatypes?

Can any one answer this?

Post your comments here:

Your comments will be displayed after verification.