Avatar of techbro
Flag for United States of America

asked on 

"NaN" in Java

I am taking a java mock exam in my exam simulator - enthuware. I am studying for a certification exam. I have approached this problem about "NaN", which I am not familiar with.

The Question is:

Which of the following statements about NaNs are true ?
A. Float.NaN == Float.NaN
B. Float.NaN == Double.NaN
C. Float.NaN >= 0
D. Float.NaN < 0
E. None of the above.

Here, Option E is the correct answer according to the exam simulator.

Since NaN means "Not a Number", it is obvious that C and D are incorrect. But I need to know why option A is not correct in this problem?

Avatar of undefined
Last Comment
Mick Barry

8/22/2022 - Mon