Learnitweb

Collection Hierarchy – Diagram

Here’s a detailed textual diagram of the Java Collection Framework hierarchy with explanations at each level. I’ve included interfaces, abstract classes, and commonly used implementations.

java.lang.Object
   |
   +-- java.util.Collection<E> (root interface for collections)
        |
        +-- java.util.List<E>           // Ordered collection (allows duplicates)
        |     |
        |     +-- java.util.AbstractList<E>  // Partial implementation
        |     |      |
        |     |      +-- java.util.ArrayList<E>
        |     |      +-- java.util.Vector<E>
        |     |              |
        |     |              +-- java.util.Stack<E>
        |     |
        |     +-- java.util.LinkedList<E>   // Doubly-linked list, also implements Deque<E>
        |
        +-- java.util.Set<E>            // No duplicate elements
        |     |
        |     +-- java.util.AbstractSet<E>   // Partial implementation
        |           |
        |           +-- java.util.HashSet<E>
        |           +-- java.util.LinkedHashSet<E>
        |           +-- java.util.TreeSet<E> // SortedSet implementation
        |
        +-- java.util.Queue<E>          // FIFO ordering, allows element insertion/removal at ends
        |     |
        |     +-- java.util.Deque<E>    // Double-ended queue
        |           |
        |           +-- java.util.ArrayDeque<E>
        |           +-- java.util.LinkedList<E>  // LinkedList also implements List<E>
        |
        +-- java.util.SortedSet<E>      // Extends Set<E>, maintains sorted order
        |     |
        |     +-- java.util.NavigableSet<E>  // Extends SortedSet<E>, provides navigation methods
        |           |
        |           +-- java.util.TreeSet<E>
        |
        +-- java.util.concurrent.ConcurrentMap (for thread-safe maps)
        
java.util.Map<K,V> (not a Collection, but part of framework)
   |
   +-- java.util.HashMap<K,V>
   +-- java.util.LinkedHashMap<K,V>
   +-- java.util.TreeMap<K,V>           // Implements NavigableMap<K,V>
   +-- java.util.Hashtable<K,V>
        |
        +-- java.util.concurrent.ConcurrentHashMap<K,V>