Difference between Compile-time Polymorphism and Run-time Polymorphism




Distinguish, differentiate, compare and explain what is the difference between Compile time Polymorphism and Run time Polymorphism. Comparison and Differences.

Differences between Compile-time Polymorphism and Run-time Polymorphism

S.No. Compile-time Polymorphism Run-time Polymorphism
1 It is implemented through method overloading. It is implemented through method overriding.
2 It is executed at the compile time since the compiler knows which method to execute depending on the number of parameters and their data. It is executed at the run time since the compiler does not know the method to be executed, whether it is the base class method that will be called or the derived class method.
3 It is also referred as static polymorphism. It is also referred as dynamic polymorphism.


Tags:

Difference between Run-time Polymorphism vs Compile-time Polymorphism

Compile-time Polymorphism vs Run-time Polymorphism

Differences between Run-time Polymorphism vs Compile-time Polymorphism

Image Credits: Freepik