When a base class is inherited as public by the derived class? What happens to its public members? What happens to its private members? If the base has inherited as private by the derived class. What happens to it public and private member?
|Subject||Object Oriented Programming|
|NU Year||Set: 4.(d) Marks: 5 Year: 2009|
• It is sometimes the case that we have a class
is nearly what we need.
• Derived classes acquire the properties of an
• The original class is called the base class.
Implementation of public inheritance
class CommissionWorker : public
– Class CommissionWorker inherits from
– friend functions not inherited
– private members of base class not accessible
from derived clas