Hello to all, welcome to therichpost,com. In this post, I will tell you, What is meant by Inheritance in programming? I can say, we use Inheritance in all programing languages and I am sharing this because this is my favorite topic because it is related to everything, even me too.
In generally, I can Inheritance like My grandfather -> My father -> Me, please don’t be confuse. This means I have some things from my father like dna, body structure and same my Father has some things in his from his father. Now I will give you clear definition:
: The process of creating new thing(me) from existing things(my father). In human beings Inheritance means, son has some property like his father like blood group, way of talking, face structure etc.
Hope you clear now that what is Inheritance.
Now I will tell you, What is meant by Inheritance in programming?
Child Class has some property of parent class called Inheritance. In php, we do Inheritance with extends keyword, which means we are extending child class with some features of parent class.
class Parent { // The parent’s class code } class Child extends Parent { // The child can use the parent's class code }
I will share more code on Inheritance and if you have any query then please do comment.
Recent Comments