View RSS Feed

Java Object

Private Members in a Superclass

Rate this Entry
by , 04-26-2012 at 06:34 PM (1328 Views)
Private members are not inherited by the subclass, of the parent class. But in case a superclass has protected or public methods to access the private fields, subclass may use them.

Nested class holds access to enclosing class’s private members-both methods & fields. Hence protected or public nested class which has been inherited by subclass holds access of superclass’s private members indirectly.

Submit "Private Members in a Superclass" to Facebook Submit "Private Members in a Superclass" to Digg Submit "Private Members in a Superclass" to del.icio.us Submit "Private Members in a Superclass" to StumbleUpon Submit "Private Members in a Superclass" to Google

Comments