Difference between over loading and over ridding?
Answer Posted / manav sharma
Overloading: Same function or operator responds differently
on different types on inputs. This is done by defining a
function (including operator fn() definition) with the same
name but different argument list.
Overriding: Redefining any base class function in a
derieved class to work differently than what is defined in
the base class. So, now the same function called with same
argument list will behave differently when called on the
objects of base and derieved class.
Important: Which instance of function to bind with the
object depends on the type of object on which the function
is called and is decided on compile time. This is also
called early binding or compile time polymorphism.
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
How long to learn object oriented programming?
What are the three main types of variables?
What is cohesion in oop?
what type of question are asked in thoughtworks pair programming round ?
What is and I oop mean?
Why is there no multiple inheritance?
write a program to find 2 power of a 5digit number with out using big int and exponent ?
What is static in oop?
Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer
what are the ways in which a constructors can be called?
what is the drawback of classical methods in oops?
What is polymorphism and example?
What do you mean by Encapsulation?
What is the main purpose of inheritance law?
What is polymorphism and why is it important?