forked from AllenDowney/ThinkJavaCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHand.java
More file actions
24 lines (21 loc) · 452 Bytes
/
Hand.java
File metadata and controls
24 lines (21 loc) · 452 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
* A hand of playing cards.
*/
public class Hand extends CardCollection {
/**
* Constructs an empty hand.
*/
public Hand(String label) {
super(label);
}
/**
* Prints the label and cards.
*/
public void display() {
System.out.println(getLabel() + ": ");
for (int i = 0; i < size(); i++) {
System.out.println(getCard(i));
}
System.out.println();
}
}