I've got a pretty simple loop:
int[] positions = {1, 0, 0}
//print content of positions
for (int i : positions)
{
if (i <= 0) i = -1;
}
//print content of positions
Now, what I would expect to get is:
array: 1, 0, 0
array: 1, -1, -1
but instead I get
array: 1, 0, 0
array: 1, 0, 0
Just... why?
Kind regards, jellyfish