G
Guest
I want to create class Matrix which contains array of class Rows and some additions
Class Rows contains array of Cells
Here is the declaration
public class Cell
public int value = 0
public int color = 0
public int background = 0
public class Row
public Cells [] cell = new Cells [10]
public int row_num
public class Matri
public Rows []row = new Rows [100]
public int new_id
// Constructo
public Matrix ()
. . .
for (int i=0; i<10; i++)
for (int j=0; j<10; j++)
row.cell[j] = i+j
. . .
Creation of class Matrix elemen
Matrix mtr = new Matrix()
causes Error in Constructor in “row.cell[j] = i+j;â€
“Object reference not set to an instance of an objectâ€. Rows are nulls and Cells are missing entirely!!
Obviously something missing in Constructor, but I have no idea how to fix it
Please hel
Class Rows contains array of Cells
Here is the declaration
public class Cell
public int value = 0
public int color = 0
public int background = 0
public class Row
public Cells [] cell = new Cells [10]
public int row_num
public class Matri
public Rows []row = new Rows [100]
public int new_id
// Constructo
public Matrix ()
. . .
for (int i=0; i<10; i++)
for (int j=0; j<10; j++)
row.cell[j] = i+j
. . .
Creation of class Matrix elemen
Matrix mtr = new Matrix()
causes Error in Constructor in “row.cell[j] = i+j;â€
“Object reference not set to an instance of an objectâ€. Rows are nulls and Cells are missing entirely!!
Obviously something missing in Constructor, but I have no idea how to fix it
Please hel