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

How does the Java for each loop work?

Ads

 
 

Share on Google+Share on Google+

Java Coder
How does the Java for each loop work?
2 Answer(s)      3 years and 6 months ago
Posted in : Java Beginners

How does the Java for each loop work?

Ads
View Answers

December 24, 2013 at 3:52 PM


Using for each loop in Java : Example



December 24, 2013 at 3:53 PM


for(Iterator<String> i = someList.iterator(); i.hasNext(); ) {
    String item = i.next();
    System.out.println(item);
}

Ads