Java Collection Frameworks
In this tutorial, we will learn about use and advantages of the Java collections framework.
Java collection framework shows a hierarchy of set of interfaces and classes that are used to manipulate group of objects and to implement different data structures and algorithms.
Java Collections Framework
Components of Collection Framework
The components of Collection Framework includes :
- Collection interfaces such as sets, lists, and maps. These are used to collect different types of objects.
- Collection classes such as ArrayList, HashSet etc that are implementations of collection interfaces.
- Algorithms that provides static methods to perform useful functions on collections, such as sorting a list.
Advantages of Collection Framework
The advantages of Collection Framework are :
- We do not have to write long codes to implement these data structures and algorithms manually.
- It is very efficient.
- We can use the Map interface to store data in key/value pairs.
- If we want to store unique data, then we can use the Set interface provided by the collections framework.