Difference between Overloading and Overriding?
Answer Posted / vetrivel
Overloading vs. overriding
1.Overriding of functions occurs when one class is inherited from another class. Overloading can occur without inheritance.
2.Overloaded functions must differ in function signature ie either number of parameters or type of parameters should differ. In overriding, function signatures must be same.
3.Overridden functions are in different scopes; whereas overloaded functions are in same scope.
4.Overriding is needed when derived class function has to do some added or different job than the base class function.
5.Overloading is used to have same name functions which behave differently depending upon parameters passed to them.
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Is facebook written in c++?
Explain one method to process an entire string as one unit?
Differentiate between a copy constructor and an overloaded assignment operator.
How much do coding jobs pay?
Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?
Is it legal in c++ to overload operator++ so that it decrements a value in your class?
What is c++ namespace?
How is data hiding achieved in c++?
How do you remove an element from a set in c++?
Can a constructor return a value?
What do c++ programmers do?
What does return 0 do in c++?
Give the difference between the type casting and automatic type conversion. Also tell a suitable C++ code to illustrate both.
Can I create my own functions in c++?
Comment on c++ standard exceptions?