Write any four differences between compile time and run time polymorphism.
Sr. No.
|
Compile-time Polymorphism
|
Run-time Polymorphism
|
1 |
Compile time polymorphism means that an object is bound to its function call at compile time.
|
Run time polymorphism means that selection of appropriate function is done at run time.
|
2 |
Functions to be called are know well before.
|
Function to be called is unknown until appropriate selection is made.
|
3 |
This does not require use of pointer to object.
|
This requires use of pointers to object.
|
4 |
Function calls are faster.
|
Function call execution is slower.
|
5 |
It is also called as early binding.
|
It is also called as late binding.
|
6 |
It also referred as static binding
|
It also referred as dynamic binding.
|
7 |
E.g. overloaded function call.
|
E.g. virtual function.
|