Answers to Self-Review Exercises

  1. 11.1

    1. Inheritance.

    2. public, protected.

    3. is-a or inheritance (for public inheritance).

    4. has-a or composition or aggregation.

    5. hierarchical.

    6. public.

    7. private.

    8. multiple inheritance.

    9. constructor.

    10. public, protected.

    11. protected, protected.

  2. 11.2

    1. True.

    2. False. A has-a relationship is implemented via composition. An is-a relationship is implemented via inheritance.

    3. False. This is an example of a has-a relationship. Class Car has an is-a relationship with class Vehicle.

    4. True.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset