Eclipse is telling me that, "The type of the expression must be an array type but it resolved to Theater"(The class for the object I created for my 2D array) on the last line of code I have below. Specifically here --> a[row]
This is just one small piece of a larger project I am working on in my Java class. You all may be familiar with it, I have to print and implement a theater seating chart using a 2D array. I have to write methods for searching by price, searching by seat, etc. Right now I am just trying to initialize the 2D array, put some values in it then print them out. Any help is much appreciated.
public class Theater {
//int[][] x = new int[9][10];
int y[][];
public Theater(){
//Initialize array
for (int row = 0; row < 3; row++)
for (int column = 0; column < 10; column++)
y[row][column] = 10;
}
public static void main(String[] args){
Theater a = new Theater();
for(int i = 0; i < 3; i++)
for (int row = 0; row < 9; row++)
for (int column = 0; column < 10; column++)
System.out.println(a[row][column]);