Inheritance Concept

Inheritance Concept

  • 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
}