• Post Reply Bookmark Topic Watch Topic
  • New Topic

nullpointer exceptions  RSS feed

 
Kayleigh Gilroy
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


So with my program I am storing an Object in the "thing" field and I need to assign it the value null to meet the exercise specifications.
I have tested this code and it seems to work but when I call "method1" from a method in of a different class I get the error message.

All help appreciated!
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kayleigh Gilroy wrote:I have tested this code and it seems to work but when I call "method1" from a method in of a different class I get the error message.

Calling that code from another class will not cause a NullPointerException unless the reference you are calling the method with is null. So we would need to see that other code before we can help you.
The full stack trace you get may also be helpful
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!