: base(fullName, age, empID, currPay, ssn)
{
// This field is defined by the Manager class.
numberOfOptions = numbOfOpts;
}
Here, the base keyword is hanging off the constructor signature (much like the syntax used to
chain constructors on a single class using the this keyword; see Chapter 5), which always indicates
a derived constructor is passing data to the immediate parent constructor. In this situation, you are
explicitly calling the five-argument constructor defined by Employee and saving yourself unneces-
sary calls during the creation of the child class. The custom SalesPerson constructor looks almost
identical:
Do'stlaringiz bilan baham: |