Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create Rank and Suit enum types and use them below. Create an immutable Card class However, override and overload the . equals methods with sigr
Create Rank and Suit enum types and use them below. Create an immutable Card class However, override and overload the . equals methods with sigr public Rank getRank(); public Suit getSuit(); public int getCribCount(); public String toString(); public static Card getCard(Rank r, Suit s) ; public static Card getCard(int i); The tostring () method should return a string like "9S" for the nine of spades. Tens can be represented either by "T" ('\u0054') or by " 0 (' \u2469 '). (Instead of C D H S for clubs, diaacceptable. Your Card class needs constructors, and internal private state variables. The static getCard mehtods should just call these constructors, as in public static Card getCard(Rank r, Suit s) \{ return new Card(r,s) ; \} public static Card getCard(int i) \{ return new Card(i); } The Card(int i ) should take a number 0i
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started