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.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL