Inheritance
Inheritance allows us to define a class that inherits all the methods and properties from another class.
The parent class is the class being inherited from, also called the base class.
The child class is the class that inherits from another class, also called derived class
Let see this situation
We will establish a parent class
But we have a small warning by class Lebron, means that Python doesn't like an empty class
If we run the program, we can see the children and inheriting the method from the parent
Inheritance
Reviewed by ohhhvictor
on
May 11, 2019
Rating:
No comments: