I am currently in a beginner level class here at Louisiana Tech University and I'm needing help with how I'm supposed to do a specific part of this assignment that is getting me stuck. I am trying to code a fixed size array that models a deck of playing cards, and I've made it through most of the assignment.
I've reached a portion of the assignment that asks to make a fixed size array of type Class and assign it to deck, which I've done. It then asks to use for loops to initialize and create each card in a deck. I created the for loops successfully, but when I inspect the Card deck object, it shows null instead of the card that were supposed to be initialized.
Here is a screenshot of my 2 classes, and how it has asked me to set the code up so far. Any help would be much appreciated!
You are filling the local variable "deck" instead of the instance variable.
this.deck = new Card;
before the loop, instead of
Card deck = new Card;
and then in the loop:
this.deck[position] = new Card(....);