Posts

Showing posts from November 18, 2010

Collection Interface

Collection Interface –
    Collection Interface has arranged on top of the Collection Framework because any class within the Collection Framework must be implement.
    Collection Interface also extends Iterable Interface so that any class can have use for-each loop for iterating the objects from Collection Interface.
    Declaration of Collection Interface is :
interface Collection<E>

    E denotes the data type of the objects which will store with in the Collection Interface
Now we are providing the Methods List with description which is framed in Collection Interface.

boolean add(Object obj) –

This method is used for add news object in the Collection. This method returns false if Collection has this object already otherwise this method add the objects and return true.

boolean addAll(Collection c) –
    This method adds all the object of Collection c and return true, otherwise return false in case of failure.

void clear() –
    This method is used for remove all element from the Collec…

Collections Framework

Image
Collections Framework –
                 Within the java.util package, there is a hierarchy of some interfaces classes enclosed within the framework for managing manipulating and accessing the groups of objects.
                 There is a figure :
                 Collections Framework was not present before J2SE 1.2. Collections Framework was added within this J2SE 1.2. Collections Framework is designed for solve the situations which many developer face in data manipulating.
                 Java Collections Framework is similar to the Standard Template Library (STL) of C++.   

                Collections Framework use the Autoboxing and unboxing technique for storing the primitive data types. References of object is used within the collection, not primitive data value

There are mainly six interfaces with in the Collections Framework 
1.    Collection Interface
2.    List Interface
3.   
Set Interface
4.   
SortedSet Interface 
5.    Map Interface
6.    SortedMap Interface 


There are some …

About Blog

This blog is designed for knowing more about the Collections Framework of java. Collections framework is heart of java. So this blog gives you a very deep knowledge about Collections Framework. For a java developer, this blog will try to provide good understanding about the Collections Framework. Through this blog, you can learn to managing groups of objects and searching data according to situations of program.

You will learn how to use For-Each Loop for iterating the value from collection.

Recent Post

Recent Posts Widget