Class for representing a card in Java? -
i'm making blackjack program in java, , starting write class declaration object card. sufficient, or there methods should have i'm glossing over?
public class card { public int suit; //value 1-4 represent suit public int value; //value 1-13 represent value (i.e. 2, j) public card(int suit, int value) { //not yet implemented } }
also, there way have c++'s enum data structure in java, because nice card names , suits?
public enum suite { heart, diamond, club, spade } public enum value { two, three, ... , jack, queen, king, ace }
and rest can figure out.
Comments
Post a Comment