My query is that bar reference has never been initialized. If it's value is null, how line no. 23 is able to compile? Why it's not throwing NullPointerException?
May be its a compiler syntax trick exactly like the following code.
t is null but still no NPE because referring to a static member through an instance variable is just a syntax trick. Compiler substitutes the instance variable with its Classname.