// MainApp.java
public class MainApp {
public static void main(String[] args) {
Deck deck = new Deck();
Hand hand1 = new Hand();
// deal 5 cards
for(int i = 0; i < 5; i++) {
Card card = deck.deal();
hand1.deal(card);
}
int handValue = hand1.getValue();
System.out.println("Hand value: " + handValue);
}
}
Heap — live objects
Console