Collections in Java
Collections in Java
Introduction
The Collection in Java is a framework that
provides an architecture to store and
manipulate the group of objects.
Java Collections can achieve all the operations
that you perform on a data such as searching,
sorting, insertion, manipulation, and deletion.
Java Collection means a single unit of objects.
Java Collection framework provides many
interfaces (Set, List, Queue, Deque) and classes
(ArrayList, Vector, LinkedList, PriorityQueue,
HashSet, LinkedHashSet, TreeSet).
What is Collection in Java
classes
Algorithm
Hierarchy of Collection Framework
Let us see the hierarchy of Collection
framework. The java.util package contains all
the classes and interfaces for the Collection
framework.
Methods of Collection Interface
No. Method Description
1 public boolean add(E e) It is used to insert an element in this collection.