Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training

Collections Framework

In this section, you will read about collection framework with its diagram and description.

Ads

Tutorials   
How to read properties file in Java? Generate random numbers in Java Cloneable Interface in Java What is the flaw with the Stack class? List In Java Java Stack Example HashSet In Java Enumeration in java How to generate random number in java Iterator in java Queue in java Transient Java Keyword clone method in Java Java Queue example Logger in Java Java current date - How to get current date in Java Collection : LinkedList Example Collection : ArrayList Example Random alpha numeric string of fixed size Java List Iterator Example The Hashtable Class The BitSet class Java Vector Java Enumeration Data Structures in Java Java Transient Variable Java Date Format Example Java Properties File Example Map.Entry Java Interface Java Property File java preferences,Change the value of Preferences by user Retrieving a Preference Node Java hasNext Write Keys and Values to the Properties file in Java Get All Keys and Values of the Properties files in Java Properties file in Java Properties file in Java Determining If a Preference Node Contains a Specific Value Change the value of Preferences by user Clone method example in Java Implementing a Simple Event Notifier Determining When a Preference Node Is Added or Removed Listening for Changes to Preference Values in a Preference Node Importing Preferences Finding a Preference in a Preference Tree Retrieving the Parent and Child Nodes of a Preference Node Determining If a Preference Node Exists Removing a Preference Node Creating a Preference Node Getting the Maximum Size of a Preference Key and Value
Ads

Collections Framework

     

Java provides the Collections Framework. In the Collection Framework, a collection represents the group of the objects. And a collection framework is the unified architecture that represent and manipulate collections. The collection framework provides a standard common programming interface to many of the most common abstraction without burdening the programmer with many procedures and interfaces. It provides a system for organizing and handling collections. This framework is based on:

  • Interfaces that categorize common collection types.
  • Classes which proves implementations of the Interfaces.
  • Algorithms which proves data and behaviors need when using collections i.e. search, sort, iterate etc.

Following is the hierarchical representation for the relationship of all four interfaces of the collection framework which illustrates the whole implementation of the framework.

     

During the designing of a software (application) it need to be remember the following relationship of the four basic interfaces of the framework are as follows:

  • The Collection interface which is the collection of objects. That permits the duplication of the value or objects.
  • Set is the interface of the collections framework which extends the Collection but forbids duplicates.
  • An another interface is the List which also extends the Collection. It allows the duplicates objects on different position because it introduces the positional indexing.
  • And Map is also a interface of the collection framework which extends neither Set nor Collection.

Some interfaces and classes of the collection framework are as follows:

INTERFACES CLASSES
Collection Interface
Iterator Interface
Set Interface
List Interface
ListIterator Interface
Map Interface
SortedSet Interface
SortedMap Interface
HashSet Class
TreeSet Class
ArrayList Class
LinkedList Class
HashMap Class
TreeMap Class
Vector Class
Stack Class

Every interfaces and classes are explained next in the roseidia.net java tutorial one by one in the various examples.

Advantage of the Collections Framework:

The collections framework offers developers the following benefits:

  • It increases the readability of your collections by providing a standard set of interfaces which has to be used by many programmers in different applications.
  • It makes your code more flexible. You can make the code flexible by using many interfaces and classes of the collection framework.
  • It offers many specific implementations of the interfaces. It allows you to choose the collection that is most fitting and which offers the highest performance for your purposes.

Interfaces of the collections framework are very easy to use. These interfaces can be transparently substituted to increase the developed application performance.

Advertisements

Ads
Share on Google+Share on Google+

Collections Framework

Posted on: April 16, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

Ads
 

Discuss: Collections Framework   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:6
polugopi
June 19, 2011
java doubt

alredy init(-) method is ther .and also it is lifecycle method.so whet is need of init() in servlets which is not lifecycle method
polu gopi
June 19, 2011
java

alredy init(-) method is ther .and also it is lifecycle method.so whet is need of init() in servlets which is not lifecycle method
satheesh
February 24, 2013
collection framework

i have to know basic concepts of collectionframework
srikanth
April 27, 2012
collection framework

thi sis srikanth
comment
May 28, 2012
comment

my comment
raja
January 25, 2014
java

what is nextInt and java.util.scanner

Ads

 

Ads