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.

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]


Be the first to comment

Leave a Reply

Your email address will not be published.