October 2001
Intermediate to advanced
640 pages
18h 58m
English
The introduction of inheritance and, in particular, the principle of substitution, has a subtle but pervasive impact on almost all aspects of a programming language. In this chapter, we will examine some of these effects, considering in detail the type system, the meaning of assignment, testing for equivalence, the creation of copies, and storage allocation.
We have described the is-a relationship as a fundamental property of inheritance. One way to view the is-a relationship is as a means of associating a type, as in a type of a variable, with a set of values—namely, the values the variable can legally hold. If a variable win is declared as an instance of a specific class— say, Window—certainly it should ...
Read now
Unlock full access