Session 12 |
Introduction to Java Collections Framework
A data structure is a collection of data organized in some fashion. The structure not only stores data but also supports operations for accessing and manipulating the data.
In object-oriented thinking, a data structure, also known as a container. A container is an object that groups multiple elements into a single unit. Typically, a container represents data items that form a natural group, such as a mail folder (a collection of letters), or a telephone directory (a mapping of names to phone numbers).
The Java Collections Framework is a collection of interfaces and classes which helps in storing and processing the data efficiently. This framework has several useful classes which have tons of useful functions which makes a programmer task super easy.
The Java Collections Framework supports two types of containers:
- One for storing a collection of elements - a collection.
- One for storing key/value pairs - a map.
The following diagram shows a brief overview of the Java Collections Framework with its commonly-used interfaces and classes (note that collections and maps are placed separately!):
Session 12 |