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
What is the c++ programming language used for?
What is the use of this pointer in c++?
what is Loop function? What are different types of Loops?
What is endl c++?
How do you initialize a string in c++?
How do you remove an element from a set in c++?
Explain the difference between struct and class in terms of access modifier.
What is the difference between method overloading and method overriding in c++?
how can i access a direct (absolute, not the offset) memory
address?
here is what i tried:
wrote a program that ask's for an address from the user,
creates a FAR pointer to that adress and shows it. then the
user can increment/decrement the value in that address by
pressing p(inc+) and m(dec-).
NOW, i compiled that program and opened it twice (in 2
different windows) and gave twice the same address to it.
now look what happen - if i change the value in
one "window" of the program, it DOES NOT change in the
other! even if they point to the same address in the memory!
here is the code snippet:
//------------------------------------------------------
#include Where Malloc(), Calloc(), and realloc() does get memory? When should overload new operator on a global basis or a class basis? Are vectors passed by reference c++? write a programme to get a character and thier ASCII value What is recursion? When is the copy constructor called?