Difference between Overloading and Overriding?

Answer Posted / samba

Overloading: We can use same method name and different
arguments, number of arguments and type of arguments, and it
is also called as Compiletime Polymorphism, EarlyBinding and
StaticBinding.
Ex: int add(int a,int b);
int add(int a, float b);
float add(int a, float b, float c);


Overriding: We can use same method name and same arguments
to perfrom our own functionality, and it is also called as
Runtime Polymorphism,LateBinding and Dynamic Binding.
Ex: int add(int,int);
int add(int,int);

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of using const reference arguments in a function?

622


What is scope resolution operator in c++ with example?

561


What is the best free c++ compiler for windows?

591


Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?

706


Explain static and dynamic memory allocation with an example each.

648






Which is better turbo c++ or dev c++?

566


When do we run a shell in the unix system? How will you tell which shell you are running?

558


What is a friend function in c++?

583


What would happen on forgetting [], while deallocating an array through new?

635


What is data types c++?

546


How would you find out if a linked-list is a cycle or not?

555


Can char be a number c++?

596


Is map sorted c++?

521


What are the basic data types used in c++?

555


What does extern mean in a function declaration in c++?

704