You are here:

C++/What is method Overriding in OOPs


I am kedar desai from india.....maharashtra....
i am learning in S.Y.IT i had some difficulty about the overriding So, can u tell me the exact deffination,it's features and the advantage and disadvantage of the method overriding?

ANSWER: Please  also have a look at:

If this does not clear your doubt, get back to me with more details of what exactly you didn't understand.

---------- FOLLOW-UP ----------

QUESTION: i got the concept of the overriding, bt still i am confused. because i heard that overriding is a part of inheritance from some sites and i heard that overridind is part of polymorphism plz sir tell me is this right if these both are right then what is the difference between these two?

Overriding means a derived class member overrides the behavior of the base class. So it is applicable to polymorphism i.e. overriding is applicable when the base class function (that is overriden in the derived class) is virtual. If the base class function() - where function() is present in both Base and Derived classes - is not virtual, the call to ptrBase->function() would not call Derived::function() but Base::function() - You would have to use ptrDerived->function() to call Derived::function() - this would not be a case of overriding.

This same thing is the topic of discussion at

Hope this helps!


All Answers

Answers by Expert:

Ask Experts


Amit Kumar


I can answer Cplusplus language and library questions, including STL, ACE, Boost. I have a good background in Mathematics.


Programming in CPP for about 8 years. Industry experience of 4 years.

Bachelors and Masters in Computer Science from Indian Institute of Technology Delhi.

©2017 All rights reserved.