lec-10
lec-10
Lecture
Programing
10
Ways Of Inheritance
You can derive a class from the Base class BUT you can also
derive a class from the Derived class.
Process of deriving a class from another Derived class.
Grandfather as Base class, Father is the derived class that has
the features of Grandfather. Then child is Derived from the
Derived / Sub class Father which inherits all the features of
Father.
Example: A
Class A
{
};
Class B : public A B
{
};
Class C : public B C
{
};
{
Diamond Problem
Person
Father Mother
Child