October 2001
Intermediate to advanced
640 pages
18h 58m
English
We say that a method in a child class overrides a method in the parent class if the two methods have the same name and type signature.1
1. As we will note in a moment, some languages require an additional keyword before overriding will take place. The feature common to all languages, however, is the parent/child relationship and the matching type signatures.
Overriding (also called inclusion polymorphism) is important when it is combined with substitution. Recall that a polymorphic variable can, using the principle of substitution, be declared as one type (for example, the parent type) but in reality hold a value of another ...
Read now
Unlock full access