It is because "test3" is a static variable. Compiler will treat it different with normal instance variables. [ May 07, 2006: Message edited by: wise owen ]
a static field is never resolved on an instance but rather on the Class itself. As the class of the (null)instance is known, it can be resolved. And it will likely be resolved at compiletime rather than runtime, at a point where the compiler either doesn't know or couldn't care less that you're having a null instance.
Many editors (and I think the compiler too if you set certain options) will generate a warning when you write this code along the line of "accessing a static member through an instance".
You can also call a static method through the null refernce. For example: class A { static void fun() { System.out.println("inside function"); } public static void main(String args[]) { A obj=null; obj.fun(); } }