java for loop index code example
Example 1: for each loop java string array
//iteration by using the enhanced for loop provided by Java 5 or later
for (String str : strArray3) {
System.out.print(str);
}
Example 2: java for loop with index
int index = 0;
for(Element song : question) {
System.out.println("Current index is: " + (index++));
}