All null values ββare untyped and equal. You can pass it to other types of links, but this does not make any difference for comparison purposes.
This is not a null value that is typed, but a reference to null that you can enter.
A common question is what happens here
class A { public static void hello() { System.out.println("Hello World"); } public static void main(String... args) { A a = null; a.hello(); System.out.println("a is an A is " + (a instanceof A));
The compiler sees type a as a , so the static method is called. But the specified value is null and untyped.
The only operations you can perform using null without throwing a NullPointerException are to assign or pass it without examining or comparing with another link.
By the way
In short: the compiler will choose a method based on the type of reference; at runtime, execution is based on the class of the object reference. At run time, null treated as a type of any type or type, or you get a NullPointerException if you try to dereference it.
source share