Top

Discussion

Which statement is true given the following?

Double d = Math.random();

  • A.
    0.0 < d>
  • B.0.0 <= d < 1.0
  • C.Compilation fail
  • D.Cannot say.

Answer: B

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

No comment is present. Be the first to comment.
Loading…

Post your comment