Created
February 27, 2018 20:29
-
-
Save nicolopignatelli/ec056fe5681188972146f6f671d98932 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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