The two primary characteristics of object-oriented programming are inheritance and polymorphism:
Inheritance allows us to group classes into families of related types, allowing for the sharing of common operations and data. For example, think of the family of exception classes that we looked at in Section 1.17.
Polymorphism allows us to program these families as a unit rather than as individual classes, giving us greater flexibility in adding or removing any particular class.
Inheritance defines a parent/child relationship. The parent defines the public interface and private implementation that are common to all its children. Each child adds to or overrides what it inherits to implement its own unique ...