This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
From Khalid Mughal: All the members of the superclass are inherited by the subclass The answer given: true Well,JLS says that Constructors ,static initializers and instance initializers are not members of the class and therefore not inherited.. But what happened to private members of the superclass?? I thought that they are not inherited but visible in the subclass object. Please Clarify Chitra
From Mughal as well "Private members are not accessible from any other class. This also applies to subclasses, whether they are in the same package or not. It is not to be confused with inheritance of members by the subclass. ~*~ Members are still inherited, but they are not accessible in the subclass. ~*~" So they are inherited but not accessible, what's the signeficance of that? I'm not sure, maybe it affects if a member in the subclass tries to hide the member in the super class. Can anyone tell?
Alferd you made a very good point. To further your argument: Let us say that a member method is inherited by sub-class because it is not private and not static. Just it happens that within this method, it access some of the private members of super class. Now you are executing this method in the sub-class as an inherited method. Technically, sub-class does not have direct access to super class private members. But via this method can access them from super class even though it is run on sub class objects. Hope this makes sense...