In Java, How do I get the current index for the element in Java?

for (Element song: question){
    song.currentIndex();         //<<want the current index.
}

In PHP you could do this:

foreach ($arr as $index => $value) {
    echo "Key: $index; Value: $value";
}

6 Answers
6

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *