I have a 2D array containing a class for each cell to contain info; ie
class gridCell {
int value;
Boolean valid;
int anotherValue;
}
gridCell[][] grid=new gridCell[50][50];
This works well and once initialized I can access the array by using
grid[10][10].value=42;
My problem is I want to create a stack or arraylist to store the grid array state at various times. When I try and create an arraylist by
ArrayList<grid> gridList=new ArrayList<grid>();
I get the error that grid is not a class. Same deal if I try and use it in a stack
Stack<grid> gridStack = new Stack<grid>();
So how can I declare the grid so it can be added to a stack or arraylist?
Any help appreciated.