Which is more efficient, a for-each loop, or an iterator?
If you are just wandering over the collection to read all of the values, then there is no difference between using an iterator or the new for loop syntax, as the new syntax just uses the iterator underwater. If however, you mean by loop the old “c-style” loop: for(int i=0; i<list.size(); i++) { Object o … Read more