| Author |
Null Pointer Exception
|
Corbin Blake
Greenhorn
Joined: Nov 10, 2004
Posts: 22
|
|
Can anybody tell me how i can get rid of a null pointer exception, that happens in a runtime error. Here are all my variables for the entire class: here is my code
|
I hope you know your paying me for this!
|
 |
Mike Gershman
Ranch Hand
Joined: Mar 13, 2004
Posts: 1272
|
|
Based on the code you showed, you never put a reference to a Sequence object into aStrand[i], so you can't modify the instance variable "sequence" of a nonexistant object. In short, aStrand contains 20 references to null. [ November 13, 2004: Message edited by: Mike Gershman ]
|
Mike Gershman
SCJP 1.4, SCWCD in process
|
 |
Mike Gershman
Ranch Hand
Joined: Mar 13, 2004
Posts: 1272
|
|
Try adding this after the declaration of aStrand:
|
 |
 |
|
|
subject: Null Pointer Exception
|
|
|