java.lang.NullPointerException (aka NPE). Yep! You're using nothing thinking it is something, roughly speaking.
A simple example:
Here is your car:
public class MyCar{
public void startEngin(){
}
Here are some cases where java.lang.NullPointerException will show up:
class Driver(){
MyCar myCar;
public void drive(){
//trying to start the engine of a car not yet created.
//we should've created it like this: myCar = new MyCar();
myCar.startEngine();
}
}
You're using an object referencing null.
No comments:
Post a Comment