Inheritance of Class with Private Memebers?
I am taking a SmartCertify Direct Java2 course. In its Packages and Inheritance
module it states:
"When you create a subclass, it cannot inherit any of the superclass's
methods and variables that are restricted by access modifiers."
My understanding had been that the access method private would not prevent
inheritance - but would prevent access (overloading/overriding) by a subclass.
• A subclass inherits all the methods and attributes of its superclass(es)
- visibility modifiers affect this: private methods & attributes can not
be accessed in a sub-class. Use protected to allow subclass access
Please elucidate my confusion over this issue.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center