Introduction to OOP: Chapter 7: Inheritance [next] [previous] [audio] [real] [text]

Heuristics for Subclassing - Limitation

The child class limits some of the behavior of the parent class.

Example, you have an existing List data type, and you want a Stack

Inherit from List, but override the methods that allow access to elements other than top so as to produce errors.

Intro OOP, Chapter 7, Slide 13