How do you know if a value is nan?



How do you know if a value is nan?..

Answer / Monika Jain

In Java, you can check if a value is NaN (Not-a-Number) using the Double.isNaN() method. For example: double x = Double.NaN; boolean isNaN = Double.isNaN(x);

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What are decalarations?

1 Answers  


what is the difference between preemptive scheduling and time slicing? : Java thread

1 Answers  


In Java why we write public static void main(String args[]) why not main()?

46 Answers   Aptech, GE Healthcare, Infosys, Microsoft, New Horizon, Practical Viva Questions, TCS, Wipro,


How do you empty a list in java?

1 Answers  


What is final method?

1 Answers  


Can a class be a super class and a sub-class at the same time? Give example.

2 Answers  


Which is faster call by value or call by reference?

1 Answers  


Explain an algorithm to find depth of a binary tree.

1 Answers   Akamai Technologies,


What is length in java?

1 Answers  


Can a class be final?

1 Answers  


what are literals in java?

2 Answers  


What is the need of transient variables in Java ?

1 Answers   MCN Solutions,


Categories