Multiple choice technology programming languages

Which one is not correct A. x = = Float.NaN B. Float.isNan(x); C. Myobject .equals(float.NaN);

  1. A

  2. B

  3. Both

  4. None of these

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Option B Float.isNan(x) is the correct approach for checking NaN. Option A x == Float.NaN is always false because NaN is not equal to anything including itself (IEEE 754 rule). Option C depends on MyObject's equals implementation - most objects won't handle NaN comparison correctly. B is the only valid answer.