Summary

In this chapter, we discovered how we can build class hierarchies through the use of inheritance between our classes. Using that technique, we can share attributes and methods from parent classes to child classes, minimizing repeated code.

In addition, we can take advantage of polymorphism to treat instances of child classes as instances of their parent class, and call methods and attributes inherited from the parent class, regardless of the type of the object we are using.

As we continue to build more and more complex programs, the ability to represent not only objects in the real world, but also the relationships and commonalities between those objects, will prove to be a very useful technique.