Raju, UseAMeaningfulSubjectLine for your topics. Just writing "null" or similar doesn't tell much about the topic. You've been reminded about this many times.
Try this simpler code
Basically, when you call a static method or access a static field on an instance of the class, the compiler replaces the instance with the type of the instance. So your code would actually look to the JVM like this
Ankit Garg wrote: when you call a static method or access a static field on an instance of the class, the compiler replaces the instance with the type of the instance.
Thanks Ankit..
Rajeev Kumar
SCJP 6.0 Certified 96%
It is an experimental device that will make my mind that most powerful force on earth! More powerful than this tiny ad!
a bit of art, as a gift, the permaculture playing cards