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”