0% found this document useful (0 votes)
4 views7 pages

Polymorphism

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views7 pages

Polymorphism

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Polymorphism

Polymorphism

What is polymorphism?
o Polymorphism means “Many Forms”.

o That is, The same entity can perform different operations in different
scenarios.

o It occurs when we have classes that are related to each other by


inheritance.
Polymorphism

Method Overloading :
o Method Overloading is the class having methods that are have the
same name with different arguments.

o Arguments will be will be differed from number of arguments and type


of argument.

o It is used in a single class.


Polymorphism

Example: Output:
Polymorphism

Method Overriding :
o Method Overriding in python is when you have two methods with the
same name that each perform different tasks.

o This is an important feature of inheritance in python.

o In method overring the child class can change its functions that are
defined by its ancestral classes.
Polymorphism

Example: Output:
Thank You

You might also like