LinkedHashMap in Java

Hierarchy diagram of LinkedHashMap in Java

LinkedHashMap in Java is a concrete class that is HashTable and LinkedList implementation of Map interface. It stores entries using a doubly-linked list. This class extends the HashMap class with a linked-list implementation that supports an ordering of the entries…

Read MoreLinkedHashMap in Java

HashMap in Java

Java HashMap hierarchy diagram

HashMap in Java is an unordered collection that stores elements (objects) in the form of key-value pairs (called entries). It is expressed as HashMap<Key, Value>, or HashMap<K, V>, where K stands for key and V for value. Both Key and…

Read MoreHashMap in Java

TreeSet in Java

TreeSet hierarchy in Java

A TreeSet in Java is another important implementation of the Set interface that is similar to the HashSet class, with one added improvement. It sorts elements in ascending order while HashSet does not maintain any order. Java TreeSet implements SortedSet…

Read MoreTreeSet in Java

Map in Java

Map in Java

A map in Java is a container object that stores elements in the form of key and value pairs. A key is a unique element (object) that serves as an “index” in the map. The element that is associated with…

Read MoreMap in Java