Home / Java Programming / Java.lang Class :: Discussion

Discussion :: Java.lang Class

  1. Which statement is true given the following?

    Double d = Math.random();

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

    View Answer

    Workspace

    Answer : Option B

    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


Be The First To Comment