-
What is the output of this program?
public class Result
{
public static void main(String args[])
{
Double num = new Double(260.1);
boolean p = num.isNaN();
System.out.print(p);
}
}
-
- 260.1
- 260
- true
- false
- None of these
Correct Option: D
num.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 260.1.