Monday, January 9, 2012

Collections API

The Collections API is a set of classes and interfaces that support operations on collections of objects.
Example of classes: HashSet, HashMap, ArrayList, LinkedList, TreeSet and TreeMap.
Example of interfaces: Collection, Set, List and Map.

 The Collection interface is the root of all collections except maps.
List
The List interface provides support for ordered collections of objects but may contain duplicate elements.Lists
implement the List interface. 
 Set 
A Set stores elements in an unordered way and does not contain duplicate elements.Sets implement the Set
interface.
Queues 
A queue is a collection that orders its elements in a specifi c order for processing.
A typical queue processes its elements in a fi rst - in, fi rst - out (FIFO) fashion, but other
ordering is possible. Queues implement the Queue interface.
Map 
A map is a collection that maps keys to values, with no duplicate keys allowed.
The elements in a map are key - value pairs. Maps implement the Map interface, which is
unique because the Map interface is not a sub interface of Collection like the other types of
collections.
 

1 comment:

Muralidhar Nayani said...

Good info on Collection API. for more visit: http://javabynataraj.blogspot.in/search/label/Collections

Post a Comment