Advertisement



< Prev
Next >



Python - Polymorphism





As explained in our previous article, the procedure of overriding the definition of a method of a class(being inherited) in its subclass is known as method overriding. This leads to an important concent - Polymorphism.

Polymorphism means having many forms and in Python, it means having a method(with the same name) in different classes through method overriding.

This allows a function to use the objects of these classes and call the overridden method, without having to worry about the actual type of objects. The definition of the method to be invoked is determined at runtime, based on the type of the object.

Don't worry if you have not got it yet, let us make it easy for you through an example of Polymorphism.




Please Subscribe

Please subscribe to our social media channels for daily updates.


Decodejava Facebook Page  DecodeJava Twitter Page Decodejava Google+ Page




Advertisement

Notifications



Please check our latest addition

PYTHON


Advertisement