Difference between revisions of "CISC181 S2017 CardClass"
From class_wiki
(Created page with " <nowiki> package cisc181.mylab_4; // Christopher Rasmussen // CISC181, University of Delaware // March, 2015 enum Suit { SPADES, CLUBS, HEARTS, DIAMONDS } enum Rank {...") |
(No difference)
|
Revision as of 16:42, 3 February 2017
package cisc181.mylab_4; // Christopher Rasmussen // CISC181, University of Delaware // March, 2015 enum Suit { SPADES, CLUBS, HEARTS, DIAMONDS } enum Rank { TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING, ACE } public class Card { Rank rank; Suit suit; // constructor: specify rank then suit Card(Rank r, Suit s) { rank = r; suit = s; } // how to print a card public String toString() { return new String(rank + " of " + suit); } }