Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error Msg

 
Mohksin Rashid
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all... may i noe what NullPointerException error means? and it says "fail to load reference image"? anyone can help?

thx in advance.


Mohksin Rashid
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NullPointerException usually refers to a calling of a method using a reference variable that is pointing to null, rather than an instance of an object.

For Instance



The numbers are there just for explaining the lines.

So on Line #2 there is no MyClass instance, so a call to runSomeMethod on using the reference variable "var" would result in a NullPointerException, because "var" is null.

Now in Line #5, that would run because now "var" points to an actual instance of MyClass created on line #4.

Hope that helps

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic