Quantcast
Channel: In detail, how does the 'for each' loop work in Java? - Stack Overflow
Viewing all articles
Browse latest Browse all 30

Answer by Pete for In detail, how does the 'for each' loop work in Java?

$
0
0

It would look something like this. Very crufty.

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

There is a good writeup on for each in the Sun documentation.


Viewing all articles
Browse latest Browse all 30

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>