Answer:
Explanation:
The following code is written in Java. It creates the Card class and then uses it to create a full house and print out the rank and suit of every card in that hand.
class Card {
int rank;
char suit;
public Card(int rank, char suit) {
this.rank = rank;
this.suit = suit;
}
public int getRank() {
return rank;
}
public char getSuit() {
return suit;
}
}
class CardTester {
public static void main(String[] args) {
Card card1 = new Card(3, '♥');
Card card2 = new Card(3, '♠');
Card card3 = new Card(3, '♦');
Card card4 = new Card(2, '♦');
Card card5 = new Card(2, '♣');
System.out.println("Card 1: " + card1.getRank() + " of " + card1.getSuit());
System.out.println("Card 2: " + card2.getRank() + " of " + card2.getSuit());
System.out.println("Card 3: " + card3.getRank() + " of " + card3.getSuit());
System.out.println("Card 4: " + card4.getRank() + " of " + card4.getSuit());
System.out.println("Card 5: " + card5.getRank() + " of " + card5.getSuit());
}
}