Hi
I'm a beginner and building a battleship game. I'm
testing an enhanced for loop and don't understand why I'm getting an outofbounds error.
I know that I can use a normal 'for' loop to make it work ie for(int cell = 0;cell<loc.length;i++)
System.out.println(loc[cell]);
but why does the enhanced for loop seem to loop past the length of the array?
cheers
Andy