Yahoo Card Games Freecell
Java array index out of bounds error?
I would like someone to look at my class an see what is wrong. I would greatly appreciate it. I am new to java and can’t figur ethis out. I get 2 errors:
Exception in thread “main” java.lang.NullPointerException
at LoadCards.find(NewEmpty.java:100)
at LoadCards.main(NewEmpty.java:16)
and
Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 52
at LoadCards.find(LoadCards.java:89)
at LoadCards.main(LoadCards.java:19)
I’m just trying to take a screen capture of a FreeCell game and find the value of the cards. All the parts seem to work on their own. When I put it all together I get the errors.
My code is here http://pastebin.com/8YHYBZJs because yahoo answers does not display it correctly.
Problem 1:
testCards never gets initialized, it’s null, did you mean to write:
testCards=getTestCards();
somewhere?
The other error I’m not able to locate, maybe it’s the wrong line number? Thanks for using pastebin btw, it makes it easier to find with those line numbers in there. I hope I can get to level 2 soon.
Nokia C6 Unlocked GSM Phone with Easy E-mail Setup, Side-Sliding Touchscreen
|
|
HOYLE CARD GAMES 2008 New PC XP Vista Win 7 NEW Sealed $11.22 |
|
|
HOYLE CARD GAMES 2008 for MAC OSX OS X New SEALED $11.22 |
|
|
Hoyle Classic Games {10 Great Card and Board Games}, Very Good Software $10.98 |
|
|
Hoyle Pocket Trivia Game Cards 1984 $10.00 |
|
|
Hoyle Card Games 2008 (PC/MAC – NEW) $4.95 |
|
|
Vintage Hoyle MGM Flickers Card Game New-Old Stock $14.99 |
|
|
Vintage Hoyle Laff-A-Lympics Old Main Card Game New-Old Stock #8 $17.99 |
|
|
Hoyle Captain Caveman Hearts Card Game New-Old Stock #7 $14.99 |
|
|
Vintage Hoyle Captain Caveman Hearts Card Game- New-Old Stock $14.99 |
|
|
Vintage Hoyle Yogi Bear Animal Rummy Card Game- New-Old Stock $9.99 |