Skip to content

Instantly share code, notes, and snippets.

@nicolopignatelli
Created February 27, 2018 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicolopignatelli/ec056fe5681188972146f6f671d98932 to your computer and use it in GitHub Desktop.
Save nicolopignatelli/ec056fe5681188972146f6f671d98932 to your computer and use it in GitHub Desktop.
final class Card {
private Rank rank;
private Suit suit;
public Card(Rank rank, Suit suit) {
this.rank = rank;
this.suit = suit;
}
public boolean sameAs(Card anotherCard) {
return rank.sameAs(anotherCard.rank) &&
suit.sameAs(anotherCard.suit);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment