foreach loop get index java 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++));
}