get index of for each loop code example
Example: java for loop with index
int index = 0;
for(Element song : question) {
System.out.println("Current index is: " + (index++));
}
int index = 0;
for(Element song : question) {
System.out.println("Current index is: " + (index++));
}