Example for declaration of base class and subclass and how subclass inherit base class
Answers
Answered by
0
Answer:
class parent
{
int i;
public :
void display()
{
cout<<"inheritance";
}
};
class child : public parent
{ int j;
};
main()
{
child c1;
c1.display();
}
object of class child will use the member function of class parent
it mean inheritance is demonstrated.
Similar questions