Create the following classes:
String suiteString faceValue
Card(String suite, String faceValue)- set the parameter fields to the instance fields
- Create a getter method called
String getSuiteto return the suite of the card. The return type is String. - Create a setter method called
void setSuite(String newSuite)and set thenewSuiteparameter to thesuitefield. There is no return type. - Create a getter method called
String getFaceValueto return the face value of the card. The return type is String. - Create a setter method called
void setFaceValue(String newFaceValue)and set thenewFaceValueparameter to thefaceValuefield.
ArrayList<Card> cards
Deck()- create an empty constructor. In the constructor, set the card field to a new instance of ArrayList.cards = new ArrayList<Card>()
- Create a getter method called
ArrayList<Card> getCardsto return the cards field. The return type is aArrayList<Card>. - Create a method called
void addCard(Card card)and add the card in the parameter to the field cards list. - Create a method called
int size()which returns how many card is in the list. - Create a method called
Card draw()which remove the card at index 0 from the list
String nameArrayList<Card> hand
Player()- create an empty constructor. In the constructor, set the hand field to a new instance of ArrayList.hand = new ArrayList<Card>()
- Create a getter method called
ArrayList<Card> getHandto return the hand field. The return type is aArrayList<Card>. - Create a method called
void takeCard(Card card)and add the card in the parameter to the field hand list. - Create a getter method called
String getNameto return the name of the player. The return type is String. - Create a setter method called
void setName(String newName)and set thenewNameparameter to thenamefield. There is no return type.
Player player1Player player2Deck deck