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

How does the Java for each loop work?

Advertisement
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);
}