Multiple choice

How many constructors of HashTable 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
C Correct answer
Explanation

This is the correct choice because there are 4 constructors of HashTable class in Java collections framework. These constructors are: 1) Hashtable(): constructs a new, empty hashtable with a default initial capacity (11) and load factor (0.75) 2) Hashtable(int initialCapacity): constructs a new, empty hashtable with the specified initial capacity and default load factor (0.75) 3) Hashtable(int initialCapacity, float loadFactor): constructs a new, empty hashtable with the specified initial capacity and the specified load factor 4) Hashtable(Map t): constructs a new hashtable with the same mappings as the given map