A

Admin • 828.03K Points
Coach

Q. Which of the following will throw a NullPointerException in TreeMap?

  • (A) Inserting null key
  • (B) Inserting null value
  • (C) Using containsKey() on null
  • (D) All of the above
  • Correct Answer - Option(A)
  • Views: 10
  • Filed under category Java
  • Hashtags: Java Map

Explanation by: Admin
TreeMap does not allow null keys if natural ordering is used.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.