Categories

Wednesday, November 20, 2024
#919814419350 therichposts@gmail.com
InheritanceTechnology

What is meant by Inheritance in programming?

meant by Inheritance in programming

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.

 

therichpost
the authortherichpost
Hello to all. Welcome to therichpost.com. Myself Ajay Malhotra and I am freelance full stack developer. I love coding. I know WordPress, Core php, Angularjs, Angular 19, MedusaJs, Next.js, Bootstrap 5, Nodejs, Laravel, Codeigniter, Shopify, Squarespace, jQuery, Google Map Api, Vuejs, Reactjs, Big commerce etc.

Leave a Reply

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