File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Null Pointer Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Null Pointer Exception" Watch "Null Pointer Exception" New topic

Null Pointer Exception

Corbin Blake

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!
Mark Patrick
Ranch Hand

Joined: Feb 22, 2004
Posts: 51
What is ".sequence"?

Mark Patrick<br />SCJP 1.4
Joyce Lee
Ranch Hand

Joined: Jul 11, 2003
Posts: 1392
Hi Corbin,

public Sequence[] aStrand = new Sequence[20];
Did you create any Sequence objects in aStrand?

For example:

You might want to take a look at Java Tutorial: Arrays.

Corbin Blake

Joined: Nov 10, 2004
Posts: 22
okay, i have it intialized now. I swore that i have tried that before but for some reason it didn't work. Thanks so much for the help.
It is sorta covered in the JavaRanch Style Guide.
subject: Null Pointer Exception
It's not a secret anymore!