Multiple choice

How many constructors of HashMap class are there in Java collections framework?

  1. 6

  2. 5

  3. 4

  4. 3

  5. 2

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

This is the correct choice because there are 3 constructors of HashMap class. These are:   HashMap(): creates a Map with default initial capacity and load factor HashMap(int initialCap, float load): creates a Map with default specified initial capacity and load factor HashMap(m : Map): creates a Map with existing Map