What are the differences between function overriding and function overloading?

I know people expect differences between in table form, but I am giving them in point form. Point 1 of function overloading and point 1 of function overriding are the differences.

Function overloading-:

1)Function overloading is when the functions have same name but differ in the number of parameters or type of parameters.

2)It can be either in base class or derived class.

3)It is achieved in compile time.

4)Overloaded functions are in same scopeĀ  [meaning inside 1 program or inside 1 bracket or inside 1 class]


Function overriding-:

1)Function overriding is the redefining of the base class function in its derived class with the same name.

2)It can be done only in derived class.

3)It is achieved in run time.

4)Overridden functions occurs in different scope [different classes generally]


Leave a Comment

Your email address will not be published. Required fields are marked *

Do NOT follow this link or you will be banned from the site! Scroll to Top