This is giving an error for me. I assumed this is syntactically correct. I have no experience with java. Only C++. Can someone tell me what I’m doing wrong?
private enum Site{
OPEN, BLOCKED }
Site[][] grid;
final Site DEFAULT_STATE = Site.OPEN;
/**
* Constructor.
*/
public GridClass(int N)
{
for(int i = 0; i < N; i++)
{
for(int j = 0; j < N; i++)
{
grid[i][j] = DEFAULT_STATE;
}
}
}
You’re only declaring
grid, you’re not defining it.You’ll need something like: