Docstoc

Java collection - quick overview

Document Sample
Java collection - quick overview Powered By Docstoc
					                                     http://www.javaservletsjspweb.in
                                         Santhosh Reddy Mandadi

Tuesday, April 24, 2012
Web URL: http://www.javaservletsjspweb.in/2012/04/what-is-java-collection-quick-overview.html


What is a Java collection - quick overview
We can use collection classes and objects to handle group of objects (other than arrays). Java has a
collection frame work to deal with collections.

Collection framework: A collection framework is a class library to handle group of objects. It is
implemented in java.util package.

Collection class: A collection class or container class is a class whose object can store a group of other
objects.

Collection object: A collection object is an object that stores a group of other objects. It is also called
container class object. The collection object stores objects references.

References of other objects are available in collection objects. All the classes in collection framework
have been divided into 3 categories.

1. Set: A group of elements (objects). A class which implements java.util.Set interface is called as a set.
Eg: HashSet, LinkedHashSet, TreeSet.

2. Lists: Collection of elements (objects). A class which implements java.util.List interface is called as a
List. Eg: LinkedList, ArrayList, Vector.

3. Maps: A map stores elements in the form of key-value pairs. Eg: Hashtable, HashMap

I'll details about each type of collection in further posts... please checkout...

				
DOCUMENT INFO
Stats:
views:38
posted:6/23/2012
language:English
pages:1
Description: A brief explanation on the Java collection - quick overview