Ir al contenido principal

Entradas

Mostrando las entradas con la etiqueta Inheritance

Inheritance

WHAT IS? Is the procedure in which one class inherits the attributes and methods of another class. The class whose properties and methods are inherited is known as the Parent class.                                        There are 5 types of inheritance:  Single Inheritance:  This is a form of inheritance in which a class inherits only one parent class. This is the simple form of inheritance and hence also referred to as simple inheritance. Here the class Child is inheriting only one class Parent, hence this is an example of Single inheritance. Multiple Inheritance:  An inheritance becomes multiple inheritances when a class inherits more than one parent class. The child class after inheriting properties from various parent classes has access to all of their objects. Here we have one Child class which is inheriting properties of three-parent classes Parent_1, Parent_2, and P...