Sparrow: Inheritance
Sparrow: Inheritance
Sparrow: Inheritance
Sparrow
They have grey head
class B : public A
where class B inherit the property of class A
A class can be derived from more than one classes, which means it can inherit
data and functions from multiple base classes.
We can summarize the data and member function of a class according to their
access specification- who can access them in the following way
A derived class inherits all base class methods with the following exceptions
Modes of Inheritance
We hardly use protected or private inheritance, but public inheritance is
commonly used. A base class's private members are never accessible directly
from a derived class, but can be accessed through calls to
the public and protected members of the base class.
Rules of Derivations