I'm writing a program using JGrasp, where tile is a class. The Following code compiles:
tile ext = new tile();
ext.assignValues(0);
g.setColor(ext.color);
g.fillRect(10+20, 35+20, 20, 20);
But the following does not:
tile[][] ext = new tile[1][1];
ext[0][0].assignValues(0);
g.setColor(ext[0][0].color);
g.fillRect(10+20, 35+20, 20, 20);
Am I initializing the 2D array wrong, or am I misunderstanding how arrays work.