I\'m making a blackjack program in Java, and I was starting to write the class declaration for an object Card. Will this be sufficient, or are there some methods I should ha
Yeah, your start looks good. Switch the ranks and suits to enums - that would be a good idea. As far as methods, create them as you go and discover you need them. Depending on the game you're writing, you may need a completely different set of methods.
Java has a very powerful enum. Check out the example below.
public enum Rank {
ACE(1, "Ace"),
TWO(2, "Two"),
... etc
KING(13, "King");
private int value;
private String display;
private Rank (int value, String display) {
this.value = value;
this.display = display;
}
public int getValue() {
return this.value;
}
public int getDisplay() {
return this.display;
}
}