What is the difference between Overloading and Overriding ?

What is the difference between Overloading and Overriding ?

Senior Developer Asked on June 19, 2017 in JAVA.
Add Comment
1 Answer(s)

Method Overloading :
{i}Used to increase the readability of the program.
{ii}It may or may not need inheritance in Method Overloading.
{iii}Overloading is a compile-time concept.
{iv}In case of method overloading, parameter must be different.

 

Method Overriding:
{i}Method Overriding means method of base class is re-defined in the derived class having same signature.
{ii}It always requires inheritance in Method Overriding.
{iii}Overriding is a run-time concept.
{iv}In case of method overriding, parameter must be same.

 

IT Head Answered on June 28, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.