Inheritance in Python – tccicomputercoaching.com
- July 12, 2019
- Posted by: Riddhi Dhandha
- Category: Python Coaching at TCCI
Inheritance is the mechanism to build a new class from old class. So, new class can access the data property of old class.
Old class is called parent class and new class is called child class.
What can child class can do?
-Child calls can reuse data or function of parent class.
-Child class can redefine function of parent class.
-Child class can add own data also.
Programming Structure of Inheritance:
Here, obj is instance created for the class child. We can call fun of parent and child both using this instance of child class.
There are types of inheritance depending number of parent and child.
1. Single inheritance
2. Multilevel inheritance
3. Multiple inheritance
4. Hierarchy inheritance
5. Hybrid inheritance
Call us @ 9825618292
Visit us @ http://tccicomputercoaching.com/