/** This driver file, Poker.java, allows us to evaluate a poker * hand. */ public class Poker { /** 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('A', 'd'); Card c2 = new Card('K', 'd'); Card c3 = new Card('Q', 'd'); Card c4 = new Card('J', 'd'); Card c5 = new Card('T', 'd'); Hand h = new Hand(c1, c2, c3, c4, c5); if (h.isRoyalFlush()) System.out.println("you have a royal flush!"); else if (h.isStraightFlush()) System.out.println("you have a straight-flush!"); else if (h.isFourOfKind()) System.out.println("you have a 4 of a kind!"); else if (h.isFullHouse()) System.out.println("you have a full house!"); else if (h.isFlush()) System.out.println("you have a flush"); else if (h.isThreeOfKind()) System.out.println("you have 3 of a kind!"); else if (h.isStraight()) System.out.println("you have a straight"); else if (h.isTwoPair()) System.out.println("you have 2 pair"); else if (h.isOnePair()) System.out.println("you have 1 pair"); else System.out.println("you have something else"); } }