CS 3304: Comparative Languages
Object-Oriented Programming
[
Course Documents
] : [
Object-Oriented Programming
]
Previous
Contents
Next
Keyword Index
Inheritance
In the simplest case, a class inherits all of the entities of its parent
Inheritance can be complicated by access controls to encapsulated entities
A class can hide entities from its subclasses
A class can hide entities from its clients
Besides inheriting methods as is, a class can modify an inherited method
The new one overrides the inherited one
The method in the parent is overridden
Single vs. multiple inheritance
One
disadvantage
of inheritance for reuse: Creates
interdependencies among classes
that complicate maintenance