-python method overriding occurs by simply defining in the child class a method with the same name of a method in the parent class.
-Function name is same in parent and child class.
#create parent class A
print("Function of class A")
#create child class B
print("Function of class B")
Function of class B
-In this program, we have a two class, one is parent class and one is child class that inherits the property of parent class.
- class A is a parent class
- class B is a child class
- Both class have same function names as 'function(self)', so this type of senerio is known as function overriding or method overriding.
- b=B(), here 'b' is an object of the child class B, and b.function() call the function of the child class not the parent function.