Skip to content

Latest commit

 

History

History
44 lines (28 loc) · 1009 Bytes

Polymorphism.md

File metadata and controls

44 lines (28 loc) · 1009 Bytes

Polymorphism

In short polymorphism is the condition of occurence in difference forms. Confused ?

Lets look a example.

Polymorphism in addition operator: main.py

x = 10
y = 20
print(x+y)

a = "Arif "
b = "Shahriar"
print(a+b)

output:

30
Arif Shahriar

Here + operator performs mathematical addition for integers and concatination for strings. Same operator does different operation for different data types. This is the Polymorphism of addition operator.

For more example checkout this link.

In the next some tutorial we will discuss about :

  1. Duck Typing

  2. Operator Overloading

  3. Method Overloading

  4. Method Overriding

Previous (Inheritance) | Next (Duck Typing)