Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Null Pointer Exception

 
Ryan Maxwell
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops... My mistake... Forgot to declare the new class... Silly me...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic