Posted by William D McQuain on November 27, 2001 at 15:47:46:
In Reply to: question about notes posted by AG on November 27, 2001 at 13:47:03:
: This is regarding the Person-Employee-Professor inheritance in the notes. The 'Professor' class has a function setID() which overrides the setID() of Employee. The Professor setID() directly accesses 'ID' which is a private member of Employee. Isn't this illegal - shouldn't 'ID' be protected instead of private in Employee?
: Will appreciate any help.
Gotta remember that there are several versions of these classes and they aren't all presented in their entirety.
Yes, the implementation you're referring to assumes that the base class has been altered to use protected data members. Wouldn't work otherwise.
Post a Followup