Quantcast
Viewing all articles
Browse latest Browse all 30

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

It's implied by nsayer's answer, but it's worth noting that the OP's for(..) syntax will work when "someList" is anything that implements java.lang.Iterable -- it doesn't have to be a list, or some collection from java.util. Even your own types, therefore, can be used with this syntax.


Viewing all articles
Browse latest Browse all 30

Trending Articles