How many constructors of HashMap class are there in java collections framework?
C
Correct answer
Explanation
This is correct, as there are 4 constructors of HashMap class. These are :-HashMap() :-
Constructs an empty HashMap with the default initial capacity (16) and the default load factor (0.75).
HashMap(int initialCapacity) :-
Constructs an empty HashMap with the specified initial capacity and the default load factor (0.75).
HashMap(int initialCapacity, float loadFactor) :-
Constructs an empty HashMap with the specified initial capacity and load factor.
HashMap(Map<? extends K,? extends V> m) :-
Constructs a new HashMap with the same mappings as the specified Map.