October 2001
Intermediate to advanced
640 pages
18h 58m
English
There is a paradox that lies at the heart of the way inheritance and substitution are used in statically typed object-oriented languages. This paradox derives from the twin concepts of subclass and subtype. In this chapter we will explore these concepts and this paradox.
To say that one class is a subclass of another is to simply assert that it has been built using inheritance. The new class is declared using an existing class as a basis, as in the following Java class declaration.
class Child extends Parent {
... // class definition
}
The point is that the subclass relationship is asserting a statement about definition, about how the new class was constructed. It says nothing ...
Read now
Unlock full access