The Collection Interfaces in java

The Collections Framework defines several interfaces

Table of Collection Interfaces

InterfaceDescription
CollectionEnables you to work with groups of objects; it is at the top of the collections
 hierarchy.
  
DequeExtends Queue to handle a double-ended queue. (Added by Java SE 6.)
ListExtends Collection to handle sequences (lists of objects).
NavigableSetExtends SortedSet to handle retrieval of elements based on closest-match
 searches. (Added by Java SE 6.)
  
QueueExtends Collection to handle special types of lists in which elements are
 removed only from the head.
  
SetExtends Collection to handle sets, which must contain unique elements.
  
SortedSetExtends Set to handle sorted sets.
  
Table of Collection Interfaces

collections also use the Comparator, RandomAccess, Iterator, and ListIterator interfaces

The Collection Interface

The Collection interface is the foundation upon which the Collections Framework is built because it must be implemented by any class that defines a collection. Collection is a generic interface that has this declaration:

interface Collection<E>

Here, E specifies the type of objects that the collection will hold. Collection extends the Iterable interface. This means that all collections can be cycled through by use of the for-each style for loop. (Recall that only classes that implement Iterable can be cycled through by the for.)

Leave a Comment