posted 16 years ago
When you do pp.x and x is a static member of pp's class (Parent) this is interpreted by the compiler as Parent.x. Notice that you still have the access control restrictions imposed by the protected access modifier. That means that when a member is both static and protected, it can be accessed by any class in the same package as the class where the member is declared, and in any subclass of the class where the member is declared. Like Abhi said, in this case you don't need an instance of the superclass to access the member, because the member is static (remember that pp.x is just notation for Parent.x.)
All code in my posts, unless a source is explicitly mentioned, is my own.