Difference Between Overloading and Overriding
What is Functional Overloading/ Method Overloading ?
If a Class has multiple methods with the same name and different parameters then it is called as function overloading.
What is Function Overriding?
If a function of a parent class is inherited in the child class with same parameter is known as Function Overriding.
|Method Overloading increases the readability of the program.||Method Overriding provides the specific implementation of the method that is already provided by its super class.|
|Parameters must be different from function to function in case of method overloading||Parameters must be same like the super class.|
|Its also known as:
Compile Time Polymorphism (or) Overloading (or) Static Binding (or) Early Binding
|It is also known as :
Runtime Polymorphism (or) Overriding (or) Dynamic Binding (or) Late Binding
|In Compile Time Polymorphism, call is resolved by compiler.||In Runtime Polymorphism, call is not resolved by compiler.|
|Overloading is Compile Time Polymorphism where more than one methods share the same name with different parameters or signature and return type||Overriding is runtime polymorphism having same methods with same parameters or signature, but associated in a class and its subclass.|
|It Provides fast execution because known early at compile time.||Runtime polymorphism is more flexible ass all things executed at runtime.|