Java: for loop, incompatible types

the second statement: grid[0].length is an integer. The second statement in a for loop is a condition statement and needs to be a boolean.

If you're trying to loop while col is less than the length of grid[0], then you need this as your second statement:

col < grid[0].length;


for (int col= 0; col < grid[0].length; col++)   // See the typo

grid[0].length is the integer that the message refered to. A boolean value was expected there:

col < grid[0].length

You need to change your code to something like:
for (int col= 0; col<grid[0].length; col++)