Static members stored in heap or stack??
796745Feb 8 2008 — edited Feb 11 2008Hi,
I had some doubt regarding where the static members of a class are stored. As you all know, we need not have an instance of a class to use its static members (instance variables or methods). Then where these static members are stored, i.e. on heap or stack?? As far as I know, only local variables or non-static methods are stored on the stack.. And only objects live on the heap!!
Also, when we initialize an object [say new Object()], and if class Object has some static members, would there again be a reference of the static members in the heap inside the object??
Please clear my doubt..