What Is Inheritance?

Inheritance mainly suggests a certain object to be able to inherit the characteristics from any other objects. In a more concrete terms, the object is something that could pass on its state as well as behaviors to the children. For the inheritance to work, the objects need to have characteristics that are common with each other.

For instance, simply put that you make a class known as the “human”, which is representing your physical characteristics. Thus, it is a generic class that could surely represent you. It is a state that simply keeps a good track of the good things just like he number of arms, legs as well as the blood type. It has the behaviors of sleeping, walking and eating. The “human” is also a good one for getting the entire sense of what makes everyone to be the same, yet if you could not, simply tell them about the differences. If that’s the case, they could simply make new types of classes known as the Man and the Woman. The state as well as the behaviors of such classes would definitely differ from each other in many ways except for those that they inherit from the HUMAN.

It only means that inheritance mainly lets you encompass the class’ state of the parent as well as the behavior in the child. So, the class of the child could then extend the state as well as the behaviors reflecting the differences that it represents.

Category: Programming Concepts

Leave a comment

You must be logged in to post a comment.