How can I access the Cell Array in my getCell method? (Java)
问题 my Task is to make an implementation of Conway's Game of Life. Therefor I need to create the class GameMap. In this class I will initialize an 2D Array. Therefor I use those two methods. private static Cell[][] buildCellArray(int width, int height){ Cell[][] cellArray = new Cell[width][height]; int i; int j; for(i = 0; i < width; i++) { for(j = 0; j < height; j++) { cellArray[i][j] = new Cell(); } } return cellArray; } public GameMap(int sizeX, int sizeY) { buildCellArray(sizeX, sizeY); } Now