4 - Programming 2 - Operator Overloading and Inheritance Ch10 - 11 - More About Inheritance
4 - Programming 2 - Operator Overloading and Inheritance Ch10 - 11 - More About Inheritance
Operator Overloading
Chapter 10 of Visual C# How to Program, 6/e
and static.
Methods that overload binary operators must take two
software.
class hierarchy.
The class hierarchy begins with class object.
(previous lecture).
libraries.
derived classes.
A derived class can customize methods it inherits from its base class.
In such cases, the derived class can override (redefine) the base-
class method with an appropriate implementation.
that base class and by members of its derived classes, but not by
clients of the class.
Protected Members
Private Members
BasePlusCommissionEmployeeMethod Earnings
The virtual and abstract keywords indicate that a base-
method virtual.
We need to declare CommissionEmployee’s Earnings
method virtual.