Multiple choice technology programming languages

Which one is not correct a. Float.isNan(x); b. x == Float.NaN; c. Myobject .equals(float.NaN);

  1. a

  2. b

  3. c

  4. Don't know

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

Float.isNan(x) is the correct way to check for NaN (option a has typo). Using x == Float.NaN always returns false because NaN is defined as not equal to any value including itself. Option c's correctness depends on Myobject's equals implementation, but Float's equals method correctly handles NaN.