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?>

[869 byte] By [comedyboy19a] at [2007-11-26 22:42:34]
# 1
You are trying to pick an object in your array from an index that is not in the array. Try debugging, the error will tell you exactly where the error occurs.
ignignokt84a at 2007-7-10 11:58:11 > top of Java-index,Java Essentials,Java Programming...
# 2
Few exceptions make more sense than ArrayIndexOutOfBoundsException!The exception tells you exactly what happened! It prints out the offending index!It gives you the line of code that fails! There is a whole stack trace! What moredo you need!?
DrLaszloJamfa at 2007-7-10 11:58:11 > top of Java-index,Java Essentials,Java Programming...