C++: Inheritance|Rules Of Inheritance(Public Inheritance)

Rules Of Inheritance

 

Public Inheritance

If inheritance type is public

• Base class public elements become public in derived class

• Base class protected elements become protected in derived class.

• Base class private elements remain private in base class itself, they cannot be accessed directly from outside the class.