Check out the example in the next section. Notice that InitialCardDeck is capitalized. That implies that it is a class variable . A class variable is a variable associated with an entire class rather than an instance of that class. The class variable is used to store an initial card deck, which can be copied to new instances of the CardDeck class rather than creating it from scratch each time.
Objects can understand the copy message, which returns a copy of an object.
Use this to copy the InitialCardDeck to new instances of the class. Read up on class variables if you're still a bit confused. Player class Create a private method for setting the cards instance variable to an empty OrderedCollection . This is useful when creating a new player, and when the player returns all their cards to the deck. In addition, adding the following methods to you your classes will help you test and incrementally debug your code.