Series: Subject: Topic:
Question: 332 of 357

What is the difference between overloading and overridding?

Asked by: Interview Candidate | Asked on: Sep 1st, 2005
Showing Answers 1 - 8 of 8 Answers

Answered On : Jul 7th, 2005

Overloading refers to -same name but different definitions and parmeters. Overriding refers to --'replacement' of methods.

Yes  1 User has rated as useful.
Login to rate this answer.

Answered On : Jul 23rd, 2005

In overloading you are extending the definition . ie if you over load a operator " + " whith a object then  them + can be used to perform the basic additoin and defintion given at the time of operator overload .  The overriding which used in Inheretence . ie if you want to change the definition .

Login to rate this answer.
Amit Banerjee

Answered On : Sep 1st, 2005

Function Overloading is the implementation of static polymorphism where same function name having different defenitions for different uses.  Function overriding is applicable for dynamic polymorphism where where the function name and the definition are same but the function call is decided at the run time according to the type of object reference.

Login to rate this answer.
ravi verma

Answered On : Oct 5th, 2005


Login to rate this answer.

Answered On : Mar 2nd, 2006

overloading:fuctions with same name but they differ by some parameters like no. of arg.,type of arg. overriding:any local function can override global functin

Login to rate this answer.

Answered On : Jan 15th, 2007

Overloading is mainly for operators and overriding is for functions

Login to rate this answer.

Overloading is related to the use of a function or an operator. For example you can use a function for adding some integers as well as floats so this function is overloaded as it works for two different kind of inputs.
Where as overiding is in the case of classes in the object oriented programming or modeling. In this perspective you make a new class interacting with an existing one by implementing some new or restricted feature. For example you click to draw a shape from the menu but in the view class and further in every class (line, rectangle, triangle and circle etc) there exists a specific draw function.

Login to rate this answer.

Additionally:Overloading is done in same scope (i.e. having two functions with same name (but different signature in same class scope or same file scope).WhileOverriding is specifically related to inheriting & inherited classes, i.e. inheriting (derived) class MAY override a function, which was already defined in inherited (base) class.Overloading functions: will have different signature (i.e. argument list is different by No of Args OR Type of Args OR Order o Args)WhileOverriding Functions: will have same signature.Overloading functions are resolved during compile timewhileOverriding functions are resolved during runtime.

Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions



twitter fb Linkedin GPlus RSS


Interview Question

 Ask Interview Question?


Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.