+3 votes
in Class 12 by kratos

Illustrate the concept of Inheritance with the help of an example.

1 Answer

+2 votes
by kratos
 
Best answer

Inheritance is the capability of one class to inherit properties from another class. For instance, Student is a class wherefrom class GraduateStudent inherits as given below:

class Student

{

protected:

char name[25];

int rollno;

public:

void readStudent();

void showStudent();

};

class GraduateStudent:protected Student

{

protected:

char subjects[50];

public:

void readAradStud();

void showGradStud();

};

...