www.gibmonks.com

Main Page




Previous Page
Next Page

[Page 683 (continued)]

Answers to Self-Review Exercises

12.1

a) Inheritance. b) protected. c) is-a or inheritance. d) has-a or composition or aggregation. e) hierarchical. f) public. g) private. h) multiple inheritance. i) constructor. j) public, protected. k) protected, protected.

12.2

a) True. b) False. A has-a relationship is implemented via composition. An is-a relationship is implemented via inheritance. c) False. This is an example of a has-a relationship. Class Car has an is-a relationship with class Vehicle. d) True. e) True.


Previous Page
Next Page