Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following Java code?
class Output
{
public static void main(String args[])
{
Double i = new Double(257.5);
boolean x = i.isNaN();
System.out.print(x);
}
}

What will be the output of the following Java code?
class Output
{
public static void main(String args[])
{
Double i = new Double(257.5);
boolean x = i.isNaN();
System.out.print(x);
}
}
a) true
b) false
c) 0
d) 1

Answer: b
Explanation: i.isNaN() method returns returns true if i is not a number and false when i is a number. Here false is returned because i is a number i:e 257.5.
Output:
false

Join The Discussion