Which interface does java.util.Hashtable implement?

By Priyanshu Vaish|Updated : June 27th, 2022

Which interface does java.util.Hashtable implement?

  1. java.util.List
  2. java.util.Collection
  3. java.util.Map
  4. java.util.HashTable

Answer C. java.util.Map

The correct answer to the question “Which interface does java.util.HashTable implement?” is java.util.Map.

Solution

A mapping between a key and a value is represented by the Java Map interface, java.util.Map. A Java Map can precisely hold pairs of keys and values. Since Map is an interface, using it necessitates creating a specific implementation of the Map interface. The following Map implementations are available through the Java Collections API:

  • java.util.HashMap
  • java.util.Hashtable
  • java.util.EnumMap
  • java.util.IdentityHashMap
  • java.util.LinkedHashMap
  • java.util.Properties
  • java.util.TreeMap
  • java.util.WeakHashMap

☛ Related Questions:

Comments

write a comment

Follow us for latest updates