posted 15 years ago
That's a good point (only instance variables are part of an object's state.)
Static references are not considered part of an object-specific state, even though they represent some sort of state. What thing do they represent the state of? The class. And like Punit mentioned about instance methods being shared by all objects of the class, the same happens with static references (and methods, of course.)
Above, when I say object-specific state, what I mean is that every object is affected by the state of the class (represented by the values of static references,) but this is not state specific to the object itself, which only encompasses the state of instance references.
[ December 19, 2008: Message edited by: Ruben Soto ]
All code in my posts, unless a source is explicitly mentioned, is my own.