import javax.swing.ImageIcon; /** * This is a class that tests the Card class. */ public class CardTester { /** * The main method in this class checks the Card operations for consistency. * @param args is not used. */ public static void main(String[] args) { ImageIcon card2s = new ImageIcon("images/2s.gif"); Card twos = new Card(card2s, 2,"spade", "Two"); System.out.println("Should be 2 of spades with value of 2: " + twos.toString()); ImageIcon card4h = new ImageIcon("images/4h.gif"); Card fourh = new Card(card4h, 4,"hearts", "Four"); System.out.println("Should be 4 of hearts with a value of 4: " + fourh.toString()); ImageIcon card13c = new ImageIcon("images/13c.gif"); Card kingc = new Card(card13c, 10,"clubs", "King"); System.out.println("Should be King of clubs with a value of 10: " + kingc.toString()); ImageIcon card14d = new ImageIcon("images/14d.gif"); Card aced = new Card(card14d, 11,"diamond", "Ace"); System.out.println("Should be Ace of Diamonds with a value of 11: " + aced.toString()); aced.setvalue(1); System.out.println("Should be Ace of Diamonds with a value of 1: " + aced.toString()); } }