12.9 Summary
In this chapter we learned about inheritance, the ability to design and implement classes that take advantage of natural relationships existing between them. These relationships provide a way for us to organize our classes. Superclasses contain general details (instance variables and methods) that pertain to an object. Subclasses contain details that allow objects to be more specific. This parent–child relationship, called an IS-A relationship, allows child objects to have all the functionality of parent objects while adding specific additional details. Another relationship called HAS-A exists when an object of one class is an instance variable of another class. This relationship is also called composition.
Key Terms
abstract ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access