SortedMap in Java

Java SortedMap hierarchy diagram

SortedMap in Java is an interface that is a subinterface of Map interface. The entries in the map are maintained in sorted ascending order based on their keys. In simple words, it guarantees that the entries are maintained in ascending…

Read MoreSortedMap in Java

Hashtable in Java

Hashtable class in Java is a concrete implementation of abstract Dictionary class. It is a data structure similar to Java HashMap that can store a collection of elements (objects) in the form of key-value pairs (entries). Key objects must implement…

Read MoreHashtable in Java

EnumMap in Java

Java EnumMap hierarchy diagram

EnumMap in Java is a concrete class that provides Map implementation whose keys are of the enum type. All the keys in the EnumMap must originate from a single enum type that is specified, implicitly or explicitly, when the map…

Read MoreEnumMap in Java

IdentityHashMap in Java

IdentityHashMap in Java is a concrete class that is similar to HashMap except that it uses reference equality (==) when comparing entries (keys and values). In simple words, Java IdentityHashMap uses reference equality (==) instead of object equality (equals() method)…

Read MoreIdentityHashMap in Java

WeakHashMap in Java

Java WeakHashMap hierarchy diagram

WeakHashMap in Java is a class that provides another Map implementation based on weak keys. It was added in JDK 1.2 version and present in java.util.WeakHashMap. Java WeakHashMap extends AbstractMap class to use HashTable with weak keys. The key of…

Read MoreWeakHashMap in Java