I am trying to put the values (integers) from the 2 dimensional array prices[][] into the cost variable of the objects in the array seatArray[][]. I think the problem is that I am trying to put the values from the prices array into nothing because the seatArray array is only full of object references to null. How would I go about fixing this?
line that calls constructor:
SeatChart seatArray = new SeatChart(givenArray);
constructor method:
public SeatChart(int[][] prices)
{
Seat[][] seatArray = new Seat[9][10];
for(int i = 0; i < 9; i++)
{
for(int j = 0; j < 10; j++)
{
seatArray[i][j].cost=prices[i][j];
}
}
}