Ishan Pandya wrote:These static fields belong to an OBJECT. this object is a Class Level object.
Each class has it own "Class" object which can be obtained by ClassName.class
The static members belong to this object.
This is my understanding. Not pretty sure about it but still.
do have a look at this Java.lang .Class
thanks
Campbell Ritchie wrote:Welcome to the Ranch If you search this forum for “pure object oriented”, you find many people have asked the same question before.
You would have to read the JVM specification to find whether the location of static members is specified. I think static fields live in the Class object, as do all methods. I presume static nested classes have Class objects of their own, referenced from the surrounding class’ Class object, bit I am not certain.