Comparing Objects

AP Computer Science A· difficulty 4/5

<code>s.equals(null)</code> (where s is non-null) returns

  • A

    Throws NullPointerException

  • B

    true

  • C

    false

    check_circle
  • D

    Compile error

Explanation

Equals returns false for null comparison; doesn't throw.

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

Related questions