Filling A List Fom Array
So basically i have a deck class with an array of 40 cards, now though i want to make a CardList(basically just a list) that represents a cuple cards or a hand, but i keep on gettin some sort ofjava.lang.ArrayIndexOutOfBoundsException but it doesnt seem to make sense.
public CardList draw (int n){
deckMarker += n;
CardList someCards = CardList.NIL;
for(int i=0;i<deckMarker;i++){
someCards = someCards.push(deck[i]);
deckMarker++;
}
return someCards;
}
this is the draw method in the deck class. can anyone help?>

