Introduction to OOP | Chapter 8: Inheritance and Substitution: | next | previous | audio | real | text |
For example, you have an existing List data type that allows items to be inserted at either end, and you override methods allowing insertion at one end in order to create a Stack.
Generally not a good idea, since it breaks the idea of substitution. But again, it is sometimes found in practice.