Java Collection Hierarchy Tutorial
The Java Collection Framework provides a well-designed set of interfaces and classes.
The java.util package contains all the classes and interfaces for the Collection framework.
Iterable Interface
The Iterable interface is the root interface for the entire collection framework.
The collection interface extends the Iterable interface. Therefore the default functionality of Iterable interface is available in Collection interface and all other child interfaces and classes.
Collection Interface
The Collection interface is the interface which is implemented by all the classes in the collection framework.
It declares the methods that every collection will have.
Hierarchy Diagram
- Iterable
- Collection
- List
- ArrayList
- LinkedList
- Vector → Stack
- Queue
- PriorityQueue
- Deque → ArrayDeque
- Set
- HashSet
- LinkedHashSet
- SortedSet → TreeSet
- List
- Collection
Note: Map interface is also part of Java collection framework, but it doesn't inherit from Collection interface.