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
Is enum a class?
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 data types in oop?
What are functions in oop?
What is abstraction encapsulation?
What are the benefits of polymorphism?
What is the real life example of polymorphism?
How to improve object oriented design skills?
What is abstraction in oop with example?
What is a class and object?
Can you inherit a private class?
What is overloading and its types?
What is methods in oop?
What is this pointer in oop?
What is encapsulation selenium?