Inheritance: Why?
What's the big deal with Inheritance?
- Allows us to create similar classes with minimal duplication of
code (code reuse).
- A subclass can be like a superclass, but with extra features
(state or methods) and can redefine/
override some behavior.
- We can use a superclass as an abstract type,
thanks to polymorphism
and dynamic binding.
Alyce Brady, Kalamazoo College