/** This driver file allows us to evaluate a poker hand. */ public class Driver { /** In the main() function, we arbitrarily set the values of the 5 * cards in our poker hand, in descending order, create a hand object, * then we print a message saying what kind of poker hand we have. * Note that here we are using the Card initial value constructor and * the Hand initial value constructor. */ public static void main(String [] args) { Card c1 = new Card('K', 'd'); Card c2 = new Card('K', 'c'); Card c3 = new Card('9', 's'); Card c4 = new Card('9', 'h'); Card c5 = new Card('9', 'd'); Hand h = new Hand(c1, c2, c3, c4, c5); if (h.isRoyalFlush()) System.out.printf("you have a royal flush!\n"); else if (h.isStraightFlush()) System.out.printf("you have a straight-flush!\n"); else if (h.isFourOfKind()) System.out.printf("you have a 4 of a kind!\n"); else if (h.isFullHouse()) System.out.printf("you have a full house!\n"); else if (h.isFlush()) System.out.printf("you have a flush\n"); else if (h.isStraight()) System.out.printf("you have a straight\n"); else if (h.isThreeOfKind()) System.out.printf("you have 3 of a kind!\n"); else if (h.isTwoPair()) System.out.printf("you have 2 pair\n"); else if (h.isOnePair()) System.out.printf("you have 1 pair\n"); else System.out.printf("you have something else\n"); } }