Results 1 to 2 of 2
- 11-22-2012, 01:21 AM #1
Member
- Join Date
- Nov 2012
- Posts
- 1
- Rep Power
- 0
Help with ArrayIndexOutOfBoundsException
I have been trying to make this work forever and it will only work for complete decks and not incomplete ones help. It works for some values but not other ones like 55,15 and other ones.
https://www.dropbox.com/s/iluuhuudiu7tsv1/HW%209.zip
Java Code:public void make()throws ArrayIndexOutOfBoundsException{ int i=0 , j=0 , q=0 ; do{ if (j>12){ j=0;} q=0; do{ Card card2 = new Card(j,q); allCards[i] = card2; System.out.println(allCards[i]); //Line 42 if(i>size){ break;} i++; q++; }while(q<4); j++; }while(i<=size-1); Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 55 at Deck.make(Deck.java:42) at testDeck.main(testDeck.java:18) }
- 11-22-2012, 01:40 AM #2
Similar Threads
-
ArrayIndexOutOfBoundsException - sometimes happens, sometimes don't
By Boreeas in forum New To JavaReplies: 3Last Post: 04-10-2011, 08:28 PM -
ArrayIndexOutOfBoundsException
By np2392 in forum New To JavaReplies: 3Last Post: 01-26-2011, 10:28 PM -
ArrayIndexOutOfBoundsException: 10 ??
By Yakg in forum New To JavaReplies: 2Last Post: 12-04-2010, 06:56 PM -
ArrayIndexOutOfBoundsException: 0
By mxsar in forum New To JavaReplies: 3Last Post: 11-16-2010, 10:59 PM -
ArrayIndexOutofBoundsException help
By filly444 in forum New To JavaReplies: 9Last Post: 09-03-2008, 05:16 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks