Summary
We've gone from simple inheritance, one of the most useful tools in the object-oriented programmer's toolbox, all the way through to multiple inheritance – one of the most complicated. Inheritance can be used to add functionality to existing classes and built-in generics. Abstracting similar code into a parent class can help increase maintainability. Methods on parent classes can be called using super
, and argument lists must be formatted safely for these calls to work when using multiple inheritance.
In the next chapter, we'll cover the subtle art of handling exceptional circumstances.