Collection Hierarchy in Java defines the relationships among various interfaces and classes that build up the Collections framework. It enables programmers to efficiently store, manipulate, and process data structures in Java.
The hierarchy of the entire collection framework consists of four core interfaces such as Collection, List, Set, Map, and two specialized interfaces named SortedSet and SortedMap for sorting.
All the interfaces and classes for the collection framework are located in java.util package. The diagram of Java collection hierarchy is shown in the below figure.
- Extends: Extends is a keyword that is used for developing inheritance between two classes and two interfaces.
- Implements: Implements is a keyword used for developing inheritance between class and interface.