We take pride in your success. We let our positivity drive us, day in and out. Talk to us at Mindfire to know us more.

Software Technology Tips

The use of enhanced for loop enables us to loop through a collection member without knowing the size or explicitly iterating elements one by one . This feature is introduced with the Java SE platform in version 5.0.
 
Have a look how it simplifies programming.
 
Old form of looping.
 
for (int i=0; i <  nameArray.length; i++)
    {
       System.out.println("Name: " + array[i]);
    }
With Java SE 5.0. an enhanced looping would be like 
 
for (String name : nameArray)
 {
    System.out.println("Name: " + name);
  }
 
where nameArray is an array of Strings 


Related Tags:

Java

Author: Partho Banerjee

top

Related Pages

  • Java/JSP/Servlets Programming
  • Java Development Projects

Java

Let us Connect!

privacy

copyright (c) Mindfire Solutions 2007-2012. Login