Hello folks,
Here´s the code:
public class TestClass {
public static void main(String[] args) {
StaticNull _null_ = null;
_null_.testNull();
}
}
class StaticNull {
public static void testNull() {
System.out.println("testNull");
}
}
I know that a static method belongs to the class, so you don´t need an
instantiated object of that class to call it. But in the code above, as
I'm calling the testNull method from a null reference, shouldn't a NullPointerException
be thrown?
Best regards,
Danniel