get position inside foeach 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++));
}