I am trying to create an ArrayList of Card objects. This will represent the users hand. I have not really worked with arraylist before so any help would be appreciated. Below is my current attempt:
class Hand {
public static final int CARDS = 4;
ArrayList<Card> hand = new ArrayList<Card>();
public Hand(){
for(int i=0; i < CARDS; i++){
hand.add(new Card());
}
}
Is this correct? and Specially if it is not correct, could somebody point out what I am doing wrong?
main()function and run it!