How does the enhanced for statement work for arrays, and how to get an iterator for an array?
If you want an Iterator over an array, you could use one of the direct implementations out there instead of wrapping the array in a List. For example: Apache Commons Collections ArrayIterator Or, this one, if you’d like to use generics: com.Ostermiller.util.ArrayIterator Note that if you want to have an Iterator over primitive types, you … Read more