Basically I would like to store information about a train within arrays. I believe I would need to use a 2d array. I can't seem to get it working correctly. I want an array that will let me keep track of the number of empty and reserved seats on each car of a train. Is this going to work for me?
int[][] seats = new int[4][10];
for (int row = 0; row < 4; row ++)
for (int col = 0; col < 10; col++)
car[row][col] = 0;
I want for this just to initialize all the seats to 0, signifying they are empty. I currently get an error message on the semi colon after int[4][10], it says "expected , {"
forstatements should be in a code block