So I'm writing a mini-board game program in Java.
The program is going to read in standard input and construct a game as directed in the input.
To help stay organized and progress my oo java skills, I am using a Cell class to act as a cell in a nxn game.
For the board game, I need to have it all in one file, and it must run from static void main.
Here's what my Cell class looks like
public class Cell{
public int x;
public int y;
.
.
.
}
I want to read the input, and assign values to each cell and then add the cells to a list such as ArrayList allCells. However, I can not the use it in a static context.
I understand that static is a single instance, so I'm confused how I would go about doing this. Is there anyway I can use a class-based system to solve this problem. Each cell is it's own individual object, so making it stat wouldn't work.
Any sort-of explanation or alternative would be amazing! Hope I was clear enough in my description.