[Solved] Cant see my created array object’s properties from main class

[ad_1]

You get null values because you don’t create any objects of class Block in your array in RowOfBlocks.

After creating the array with:

this.blocks = new block[numofBlocks];

in the method body of generateBlocks()

You have to iterate over it and insert actual blocks:

for(int i=0 ; i < this.blocks.length ; i++) {
     this.blocks[i] = new Block();
}

1

[ad_2]

solved Cant see my created array object’s properties from main class