Comparing Objects

AP Computer Science A· difficulty 4/5

<code>null.equals(s)</code> causes

  • A

    false

  • B

    true

  • C

    NullPointerException

    check_circle
  • D

    Compile error

Explanation

Calling a method on null reference always throws NPE.

Want 10 more like this — adaptive to your weak spots?

Related questions