forked from AllenDowney/ThinkJavaCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeck.java
More file actions
19 lines (16 loc) · 379 Bytes
/
Deck.java
File metadata and controls
19 lines (16 loc) · 379 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
* A deck of playing cards.
*/
public class Deck extends CardCollection {
/**
* Constructs a standard deck of 52 cards.
*/
public Deck(String label) {
super(label);
for (int suit = 0; suit <= 3; suit++) {
for (int rank = 1; rank <= 13; rank++) {
addCard(new Card(rank, suit));
}
}
}
}