The Collections Framework is made up
of a set of interfaces for storing and manipulating groups of data
into a single unit. It consists
of several interfaces, and classes that implement those interfaces, contained within the java.util
package. It provides tools for maintaining a data container of objects.
The following diagrams shows the framework of core collection interfaces hierarchy.
Table of the ordered and unordered Collection
interfaces shown as:
The Collection interface
is the root interface for the Java collections hierarchy. It is extended
by the List, Set, and the SortedSet interfaces. The Collection
interface is used to represent a group of
objects, or elements. Typically, it represents
data items that form a natural group. Some collection allows duplicate elements
while others do not. It consists of both ordered and unordered elements.
public interface Collection<E>..
The <E> syntax tells that, the declared interface is a generic
interface i.e. when you declare a Collection instance you should specify the type of object contained in the collection.
Following methods can be used for adding and deleting an element respectively.
boolean add(Object element)
The list of other methods belonging to the Collection interface is shown in the table given below