Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 5

09 Polymorphism

Function Overloading, Function overridng


Polymorphism
• Word “Polymorphism” having many form
• Polymorphism is feature of Object oriented programming which is the
ability to display a single entity in more than one form is called
Polymorphism
• Types of Polymorphism
• Compile-time Polymorphism – Function Overloading, Operator Overloading
• Run-time Polymorphism – Function Overriding
Function Overloading
• Functions having the same name but different parameters and
definition is called function overloading
Operator Overloading
• C++ provides the ability for an operator to perform more than one
task that is called operator overloading
• Such as + can be used to perform arithmetic addition on two numeric
value but it can also be used for string operands to concatenate two
strings
Function Overriding
• Function overriding is functions having the same name and parameter
but different definitions is called is function overriding
• For implementing Function overriding we require two classes Base
and child class

You might also like