InheritanceTechnology

What is meant by Inheritance in programming?

meant by Inheritance in programming

Views

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.

 

Ajay Malhotra
the authorAjay Malhotra
Hello to all. Welcome to therichpost.com. Myself Ajay Malhotra and I am full stack developer. I love coding. I know Wordpress, Core php, Angularjs, Angular 2, Angular 6, Angular 7, laravel, Codeigniter, Shopify, Squarespace, Jquery, Google Map Api, Vuejs, Reactjs, Bigcommerce etc.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Positive SSL