What is the super class of hash table?

  1. Dictionary

  2. Comparative

  3. HashMap

  4. Treeset


Correct Option: A
Explanation:

To answer this question, the user needs to know about the concept of inheritance in object-oriented programming and the relationship between classes.

The super class of hash table is the Dictionary class.

Option A is correct because Dictionary is the superclass of Hashtable. In Java, the Hashtable class extends the Dictionary class to inherit its methods and properties.

Option B is incorrect because there is no superclass called Comparative for Hashtable or any other Java collection class.

Option C is incorrect because HashMap is not the superclass of Hashtable. Although both classes are used for mapping keys to values, they have different implementation details and are not related by inheritance.

Option D is incorrect because Treeset is also not the superclass of Hashtable. Treeset is a class that implements the Set interface and is used to store a sorted collection of unique elements.

Therefore, the correct answer is:

The Answer is: A

Find more quizzes: