public final class Deck
extends java.lang.Object
Card
objects.Modifier and Type | Field | Description |
---|---|---|
private java.util.ArrayList<Card> |
deck |
Stores the 52 cards of the deck.
|
Constructor | Description |
---|---|
Deck() |
Constructs a new
Deck object. |
Modifier and Type | Method | Description |
---|---|---|
void |
create() |
Fills the deck with the 52 cards in a random order.
|
Card |
draw() |
|
void |
shuffle() |
Shuffles the cards stored in the deck in a random order.
|
java.lang.String |
toString() |
private java.util.ArrayList<Card> deck
public Deck()
Deck
object. The deck array list is initialized upon object construction.public void create()
public void shuffle()
public Card draw()
public java.lang.String toString()
toString
in class java.lang.Object