Java collection framework

The Java Collections Framework  (JCF) provides many important classes and interfaces to collect and organize group of alike objects.which helps in storing and processing the data efficiently.JDK 1.2 introduces a new framework for collections of objects, called the Java Collections Framework.   This framework has several useful classes which have tons of useful functions which makes a programmer task super easy.

Hierarchy of Collection Framework

 

List -Interfaces

The List interface extends Collection and declares the behavior of a collection that stores a sequence of elements.A List is an ordered Collection . Lists may contain duplicate elements. A list collection stores elements by insertion order (either at the end or at a specific position in the list).A list can store objects of any types. Primitive types are automatically converted to corresponding wrapper types, e.g. integer numbers are converted to Integer objects.The List is the base interface for all list types, and there  implementation class are ArrayList , LinkedList  and vector .

Set-Interfaces

A set is a Interface that does not contain duplicate values. In provides three general purpose implementations in Java like  HashSet, TreeSet, and LinkedHashSet.

Map-Interfaces

A map contains values based on the key i.e. key and value pair.Each pair is known as an entry.Map contains only unique elements.. A map cannot contain duplicate keys. There are three main implementations of Map interfaces: HashMap, TreeMap, and LinkedHashMap.

3 thoughts on “Java collection framework

Leave a comment