Check out the third–from–last sentence, "Similarly it is not ...", at the bottom of this page in the javadocs guide
The For-Each Loop.
public class Test {
public static void main(String[] args) {
String[] strs = new String[5];
int count = 0;
for(String s : strs) {
System.out.println("count = " + count++);
s = "alfred e neuman";
}
for(String s : strs)
System.out.println(s);
System.out.println("----------------");
for(int j =0; j < strs.length; j++)
strs[j] = "tally ho";
for(String s : strs)
System.out.println(s);
}
}