How can you refer to the index of an array in the foreach?
My code
String[] name = { "hello", "world" };
for ( int k : name[k] ) {
--- cut ---
}
I expecting that the foreach -loop will
1. set k = 0 in first iteration so that name[0] works correctly
2. set k = 1 in the next iteration...
I get the error message
foreach not applicable to expression type