Polymorphism What is Polymorphism Polymorphism is the ability
Polymorphism
What is Polymorphism • Polymorphism is the ability of an object to take on many forms. • Polymorphism is the capability of an action or method to do different things based on the object that it is acting upon.
Polymorphism Compile Time Function Overloading Operator Overloading Run Time Virtual Function
What is Binding • Binding refers to linking of a function call to the code of function to be executed in response to the function call.
Types of Binding • Static Binding or Early Binding. • Dynamic Binding or Late Binding
Static Binding or Early Binding • Early binding - Assigning values to variables during design time or exposing object model at design time. • Early binding (also called static binding) means the compiler is able to directly associate the identifier name (such as a function or variable name) with a machine address.
Dynamic Binding or Late Binding • Bind the object library in code at run-time.
What is Virtual Function • Virtual functions are defined in Base Class and implemented in the Derived Class. • A virtual function is a member function you may redefine for other derived classes. • Declared with keyword virtual
Pure Virtual Function A Pure Virtual Function declared with no definition base class contains no implementation at all
- Slides: 9