A

Admin • 828.03K Points
Coach

Q. Which of these maps throws a `NullPointerException` when `null` is used as a key?

  • (A) HashMap
  • (B) TreeMap
  • (C) LinkedHashMap
  • (D) ConcurrentHashMap
  • Correct Answer - Option(D)
  • Views: 11
  • Filed under category Java
  • Hashtags: Java Map

Explanation by: Admin
ConcurrentHashMap does not allow null keys or null values.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.