GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Concepts  >  OOPS
Go To First  |  Previous Question  |  Next Question 
 OOPS  |  Question 7 of 64    Print  
What is the use/advantage of function overloading
Please suggest use of FO


  
Total Answers and Comments: 12 Last Update: October 10, 2007     Asked by: harsha 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
  Sorting Options  
  Page 1 of 2   « First    1    2    >     Last »  
October 07, 2005 13:26:23   #1  
jyothi        

RE: What is the use/advantage of function overloading
the use of function overloading is to save the memory space.
 
Is this answer useful? Yes | No
October 20, 2005 02:07:19   #2  
EswaraPrasad        

RE: What is the use/advantage of function overloading

the use of function overloading is to save the memory space,consistency and readabiliy.


 
Is this answer useful? Yes | No
November 17, 2005 04:42:43   #3  
venkatesh        

RE: What is the use/advantage of function overloading
we can develop more than one function with the same name
 
Is this answer useful? Yes | No
March 28, 2006 07:08:45   #4  
Malathi        

RE: What is the use/advantage of function overloading
function overloading is essential to allow the function name (for example the constructor) to be used with different argument types.
 
Is this answer useful? Yes | No
March 28, 2006 08:29:06   #5  
navneet sahota        

RE: What is the use/advantage of function overloading
how memory space is saved?
 
Is this answer useful? Yes | No
April 25, 2006 13:34:32   #6  
asp_sridhar Member Since: April 2006   Contribution: 1    

RE: What is the use/advantage of function overloading
how the memorey space is saved???
 
Is this answer useful? Yes | No
October 12, 2006 03:07:03   #7  
ABHAY        

RE: What is the use/advantage of function overloading

Overloading: providing multiple behaviour to same object with respect to attributes of object.

see in programming, every thing is object. u r program also an object, function is also an object.

by using function overloading, we can  call specific behaviour of that according to what attributes we set at  compiled time.

mean we don't need to write different function name for different action.


 
Is this answer useful? Yes | No
May 05, 2007 05:00:07   #8  
Dhananjoy Chakraborty        

RE: What is the use/advantage of function overloading
Function overloading exhibits the behavior of polymorphism which helps to get different behaviour, although there will be some link using same name of function. Another powerful use is constructor overloading , which helps to create objects differently and it also helps a lot in inheritance.
 
Is this answer useful? Yes | No
May 07, 2007 07:11:08   #9  
Sunny        

RE: What is the use/advantage of function overloading

For eg: Say a method called addUs(a,b) adds a and b.
So the definition will be

int addUs(int a, int b){

 return a+b;

}

But now if you want your arguments to be Objects of a class say
class Demo{
int height;
int width;
}
You want the same function addUs() to return a new object which would have attributes height and width having values as sum of the height & width of the 2 arguments passed.

So now the definition would be:

Demo addUs(Demo a, Demo b){
 this.height = a.height + b.height;
 this.widht = a.widht + b.width;
 return this;
}


 
Is this answer useful? Yes | No
July 28, 2007 13:33:32   #10  
sharda prasad singh        

RE: What is the use/advantage of function overloading
Function overloading is one or more funcation has different number of argument or diffrent type of argument but all have same return type otherwise it create ambitious to knowing which function u may want to call. It is also save the memory space and provide compile time polymorphysm.
 
Is this answer useful? Yes | No
  Page 1 of 2   « First    1    2    >     Last »  


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape