Discuss in brief about class hierarchies

Estudies4you

Defining Class Hierarchy

Q11. Discuss in brief about class hierarchies.
Answer: 
In C+4, it is possible to organize classes in the form. of a structure that corresponds to hierarchical inheritance. All the child classes can inherit the properties of their parent classes. A parent class that does not have any direct instance is called as an abstract class. It is used in the creation of sub-classes.

Example
Let, ‘Meher’ be a florist, but a florist is a more specific form of shopkeeper. Additionally, a shopkeeper is a human and a human is definitely a mammal. But, a mammal is an animal and animal is a material object.
All these categories along with their relationships can be represented using a graphical technique as shown in figure. Each category is regarded as a class.
Inheritance is nothing but a principle, according to which knowledge of a category or a class which is more general car also be applied to a category or a class which is more specific.
Discuss in brief about class hierarchies,Defining Class Hierarchy,explain class hierarchy in c++,examples of class hierarchies in c++,varaka kiran kumar,estudies4you,c++ lecture notes,c++ notes,jntuh c++ notes,c++ study material
Figure: Class Hierarchy for Different Kinds of Material Objects

To Top