Multiple choice

Which of the following constructor of the HashMap gives NullPointerException in the java collection framework?

  1. HashMap (Map m)

  2. HashMap (int initialCapacity)

  3. HashMap(int initialCapacity, float loadFactor)

  4. HashMap()

  5. None of the above

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

This constructor of the HashMap will give NullPointerException, if the specified map is null.