Skip to main content
Engineering LibreTexts

3: Arrays of Objects

  • Page ID
    15290
  • In the remaining chapters, we will develop programs that work with playing cards and decks of cards. Here is an outline of the road ahead:

    • In this chapter, we define a Card class and write methods that work with cards and arrays of cards.
    • In Chapter 13.1, we create a Deck class that encapsulates an array of cards, and we write methods that operate on decks.
    • In Chapter 14, we introduce inheritance as a way to create new classes that extend existing classes. We then use all these classes to implement the card game Crazy Eights.

    The code for this chapter is in Card.java, which is in the directory ch12 in the repository for this book. Instructions for downloading this code are in [Section 0.4].