<<< Inheritance and Composition     Index     Inheritance, continued >>>

2. Inheritance


  • Inheritance advantage:

    • if base class operations change, no other changes would be required in the derived classes.

  • The idea cf inheritance is to go from the general to the specific by factoring out commonality.

  • Sometimes factoring out is a multi-step process:

    • The GoldenRetriever class inherits from the Dog class

    Dog class
<<< Inheritance and Composition     Index     Inheritance, continued >>>