I currently have a 2d array named grid which can store from 0-9 both included. Now if i try to access let's say grid[11][11], the program will give a NullPointerException. I tried this code but to no avail:
if(grid[r][c] == null){System.out.println("Do nothing")}. I am getting this error: incomparable types: int and <nulltype>. Is there any way to produce the same result with different code?