aspose file tools*
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 Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Null Pointer Exception" Watch "Null Pointer Exception" New topic
Author

Null Pointer Exception

Ryan Maxwell
Greenhorn

Joined: Mar 21, 2006
Posts: 7
Hey... I keep getting a null pointer exception and I'm not sure why... I'm attempting to pass an object Person to another class where the object will be stored....

Something like:

storePerson.addPerson(PersonOne);

and the class storePerson has the method

and the addPerson method starts with

public void addPerson(Person PersonOne){


}

So, why am I getting the null pointer?
Ryan Maxwell
Greenhorn

Joined: Mar 21, 2006
Posts: 7
Oops... My mistake... Forgot to declare the new class... Silly me...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Null Pointer Exception
 
Similar Threads
Object Creation in Super Class
Compile Error Vs runtime Error
System.out
NULL Pointer Exception from the class which extends Hash Map. urgent help please
NULL Pointer Exception from the class while accessing from EJB/ HttpSession