On Eclipse choose New > Interface
public interface CardGame {
void setHand(int cardCount);
int getHand();
void setPlayers(int playerCount);
int getPlayers();
}
Base on these methods, create a PokerGame
class that implements CardGame
public class PokerGame implements CardGame {
private int cardCount = 5;
private int playerCount;
public void setHand(int cardCount) {
this.cardCount = cardCount;
}
public int getHand() {
return cardCount;
}
public void setPlayers(int playerCount) {
this.playerCount = playerCount;
}
public int getPlayers() {
return playerCount;
}
}
In your groups, discuss how to write a better interface for a card game.
Think about different card games you know. What do they all have in common?
What is specific to a Poker Game?