Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am attempting to adding a new Hand to my arrasylist for every Player(aka Playe

ID: 3607724 • Letter: I

Question

I am attempting to adding a new Hand to my arrasylist for every Player(aka PlayerCount). My current code is giving me an error on the line
players.add(new Hand()); and i am confused as to what i should do to actually have this section do what i am attempting to do


public class FiveCardStud
{
private Deck myDeck;
private ArrayList<Hand> players;


public FiveCardStud(int PlayerCount)
{
if (PlayerCount < 2)
{
System.out.println(PlayerCount + " is to small! The PlayerCount has been set to 2.");
PlayerCount = 2;
}  
else if (PlayerCount > 6)
{
System.out.println(PlayerCount + " is to big! The PlayerCount has been set to 6.");
PlayerCount = 6;
}
int index=0;
while(index < PlayerCount)
{
players.add(new Hand());
index++;
}

Explanation / Answer

Add in more data, I need the whole FiveCardStud class and hand class please.

Hi, this is a placeholder text from me, I don't take timers really well, I'll paste in the code real soon. Please do wait!