Collections in Java Part III : List

Hello Friends,

This is part III for java collections tutorial. Earlier we have discussed regarding SET collection interface in part II. In this, we will be focusing on an interface that is used when the sequence of the elements needs to be maintained, yes that’s right its LIST interface. List interface in Java Collection Framework also extends the base interface, Collection.  Continue reading “Collections in Java Part III : List”

Iterating Collections and Arrays

Hello Friends,

This is one of tutorials regarding the iterating Collections and Arrays. There are two ways of iterating the elements in the Collections or Arrays. One of the method is using the Iterator and another is using the advanced for loop or foreach statement.  Iterator are used instead of Enumeration in Java and are used to iterate the elements in particular collection. Iterator is mostly used with the collection framework. Whereas advance for loop, introduced in JDK ver. 5, is used with collections and Arrays. It is the enhancement in the for statements, it does not include any type of counters as that of simple for loop. Continue reading “Iterating Collections and Arrays”

Collections in Java Part II : Sets

Hello Friends,

This is part II for the collections tutorial, earlier we discussed the basics of collection framework. In this part,we will look at the one of the child interface, the SET interface.

A Set is the collection that contains no duplicate elements. Any class implementing the Set interface is not permitted to have duplicate entries, to be more precised, no two elements in the Set s1 ans s2 are such that s1.equals(s2). The Set interface extends the super interface – Collection interface, however there is one subInterface of Set called as SortedSet. Continue reading “Collections in Java Part II : Sets”

Collections in Java Part I : Introduction.

Hello Friends,

This is one of my tutorials regarding one of the best feature in java i.e. Collections Framework. First of all, we need to understand the basic characteristics regarding this.

Why Collections?

In the versions prior to 1.2 the standard methods for grouping Java objects were via the Array, the Vector, and the HashTable classes, which were not easy to extend, and did not implement a standard member interface.

Collections:  Introduction.

A collection, in general, means something like a group of objects stored in a structured manner, it is also called as a container. The Java collections framework is a set of classes and interfaces that implements commonly reusable collection data structures. Continue reading “Collections in Java Part I : Introduction.”