Question
class Output {
public static void main(String args[]) {
Double i = new Double(257.5);
boolean x = i.isNaN();
System.out.print(x);
}
}
What is the output of this program?
class Output {
public static void main(String args[]) {
Double i = new Double(257.5);
boolean x = i.isNaN();
System.out.print(x);
}
}
Answer: Option B
Was this answer helpful ?
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:
$ javac Output.java
$ java Output
false
Was this answer helpful ?
More Questions on This Topic :
Question 7.
Which of these class have only one field?
....
Submit Solution