How do I get current index/key in "for each" loop
<p>How do I get the current index for the song element in Java?</p>

<pre><code>for (Element song: question){
    song.currentIndex() ??
}
</code></pre>

<p>In PHP you could do</p>

<pre><code>foreach ($arr as $index =&gt; $value) {
    echo "Key: $index; Value: $value";
}
</code></pre>
