What is collection:
1. When we want to represent group of an entity into single entity then we should go for collection.
2. It allows us to achieve sorting order, insertion order, remove duplicates, operations based FIFO & LIFO, searching, manipulations, fast retrieving of objects/data, add or remove of objects/data.
3. It mainly consist of List, Set and Queue interfaces which allows us to perform many operations and provides ready made methods for several operations.
4. All the classes and interfaces in "java.util" belongs to Collections
Fig: Collection hierarchy |