Learn Java Programming - Enhanced For Statement Tutorial
The enhanced for statement (aka for-each loop) is used to iterate through the elements of a collection of objects, such as an array. In this tutorial we are going to build on the knowledge you gained from both the Single Dimensional Array tutorial and the For Loop Statement Tutorial. The nice thing about an enhanced for loop is that you do not need to know the number of elements in the array prior to reading the array. All elements of the array are sequentially read from index 0 through the end of the array. This is how the enhanced for loop is structured:













