June 2006
Intermediate to advanced
1344 pages
42h 52m
English
Section 10.4 created a commission employee class hierarchy, in which class BasePlusCommissionEmployee inherited from class CommissionEmployee. The examples in that section manipulated CommissionEmployee and BasePlusCommissionEmployee objects by using references to them to invoke their methods. We aimed base class references at base class objects and derived class references at derived class objects. These assignments are natural and straightforward—base class references are intended to refer to base class objects, and derived class references are intended to refer to derived class objects. However, as you will soon see, some “crossover” assignments are possible.
In the next example, we aim a base class ...
Read now
Unlock full access