I wrote this program in Java
public class Why {
public static void test() {
System.out.println("Passed");
}
public static void main(String[] args) {
Why NULL = null;
NULL.test();
}
}
I read that invoking a method on a null object causes NullPointerException, and yet the above program doesn't? Why is this? Am I not understanding something correctly?