Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is function overloading and operator overloading?

Answers were Sorted based on User's Feedback



What is function overloading and operator overloading?..

Answer / jerry

function overloading - function name will be same but
operation will be different for eg:

if we take the function as area
then 1. area(int x,int y)
2. area(int x);
these r the two functions with the same name but
they will differ by their arguments given
for the 1st function
it becomes the area of the rectangle=x*y
for the 2nd function it becomes the area of square=x*x


coming to the operator overloading,
it is an overloading function of an operator.
if we + as an operator
a+b then + is operator for the operands a,b
c+d then + is also an poperator for the c,b.
these r the two properties of polymorphism.

Is This Answer Correct ?    53 Yes 12 No

What is function overloading and operator overloading?..

Answer / manjeetsheoran

we can use the same function name but function signature are
differnt is called function overloading
for example
niit(int a int b)
niit(int a string name)

Is This Answer Correct ?    10 Yes 2 No

What is function overloading and operator overloading?..

Answer / sagar sapkota

A function is overloaded when same name is given to different function. However, the two functions with the same name will differ at least in one of the following.

a) The number of parameters
b) The data type of parameters
c) The order of appearance

These three together are referred to as the function signature.

For example if we have two functions :

void foo(int i,char a);
void boo(int j,char b);

Their signature is the same (int ,char) but a function

void moo(int i,int j) ; has a signature (int, int) which is different

While overloading a function, the return type of the functions need to be the same.

In general functions are overloaded when :

1. Functions differ in function signature.
2. Return type of the functions is the same.

Operator overloading allows existing C++ operators to be redefined so that they work on objects of user-defined classes. Overloaded operators are syntactic sugar for equivalent function calls. They form a pleasant facade that doesn't add anything fundamental to the language (but they can improve understandability and reduce maintenance costs).

Is This Answer Correct ?    8 Yes 2 No

What is function overloading and operator overloading?..

Answer / jha

Both function overloading and operator overloading is same
thing we can reuse the thing. In operator overloading we
can reuse the operator and user can work through object;
In function overloading we can overloading the same method
in derived class.

Is This Answer Correct ?    28 Yes 36 No

Post New Answer

More OOPS Interview Questions

Why we use classes in oop?

0 Answers  


What are objects in oop?

0 Answers  


What is the renewal class?

0 Answers   Ebix, IBM,


What is coupling in oop?

0 Answers  


What are the four main oops concepts?

1 Answers  


WRITE A SIMPLE C++ PROGRAM TO SWAP TWO NOS WITHOUT USING TEMP

2 Answers  


What is multiple inheritance?

9 Answers   TCS,


write a progra in c++ using class & object to find out wheather a given no. is prim or not.

2 Answers  


How would you stop a class from class from being derived or inherited.

18 Answers   Ness Technologies,


What is the example of polymorphism?

0 Answers  


Which is faster post increment or pre increment ? and in which cases should u use either - to increase speed?

4 Answers   EA Electronic Arts,


What are main features of oop?

0 Answers  


Categories