Sail E0 Webinar
Question


What is the output of this program?


class Output {
public static void main(String args[]) {
Double i = new Double(257.5);
Double x = i.MAX_VALUE;
System.out.print(x);
}
}
Options:
A .  0
B .  1.7976931348623157E308
C .  1.7976931348623157E30
D .  None of the mentioned
Answer: Option B

The super class of Double class defines a constant MAX_VALUE above which a 

number is considered to be infinity. MAX_VALUE is 1.7976931348623157E308.
Output:
$ javac Output.java
$ java Output
1.7976931348623157E308



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers