Like a child inherit many properties and behaviors from parents, the same can be done in programming called Inheritance.
Parent class
Parent{
// owns a house
}
- Child class inherited from the parent class
Child Inherits From Parent{
// automatically get the house as he is a child
// can add own properties and behavior - play basketball, change hair color
}
Top comments (6)
Seriously?
have to add more?
A lot more, maybe some real use case examples like inheriting methods to avoid duplication?
It was a part of my 1 minute guide, so I want it to be as simple as possible, maybe write a full blog on OOPS.
oh, okay. Mentioning that in the title would be much helpful, like, "Inheritance Concept explained as simple as possible?"
Yes :)