Inheritance
Inheritance is the important property of object-oriented programming that imparts the ability to a class to inherit properties and behaviour of another class. Inheritance is the property by which the objects of the derived class posses the copies of the data members and member functions of the base class.
Syntax:
Class base:>Statement<class Derived(base):>Statement<
For example:
Base class:
A base class is actually a superclass and the class from which it is derived is called a Base, super or a parent class.
Derived class:
A derived class is a subclass. A class that inherits or derives attributes from another class is called Derived, sub or a child class.
Types of Inheritance in Python
1.Single Inheritance.
2.Multiple Inheritance.
3.Multilevel Inheritance.
4.Hierarchical Inheritance.
5.Hybrid Inheritance.
0 Comments
Doubts? Please let our team know So that we can serve you better.