What is function overloading?,describe it with the example.

Answers were Sorted based on User's Feedback



What is function overloading?,describe it with the example...

Answer / senthil.k,arasur

The function overloading is the same function name with
different arguments.
example:

float sum(float a,float b);
int sum(int a,int b,int c);

Is This Answer Correct ?    9 Yes 0 No

What is function overloading?,describe it with the example...

Answer / prajapati paresh

the function having the same name but different argument or
different return value is called function overloading
for e.g void sum(int a,intb);
void sum(int a,int b,int c);

Is This Answer Correct ?    9 Yes 2 No

What is function overloading?,describe it with the example...

Answer / jyoti lohani

A class having same name with the same function name but
having different parameter . the paramerter are sequence of
parameter, number of parameter, & types of parameter.
that's call function overloading.

EX:- public int fun(int a,int b);
public int fun(string a, string b)

Is This Answer Correct ?    5 Yes 2 No

What is function overloading?,describe it with the example...

Answer / mayank kumar

function overloading means the name of the function is same
but the signature is diffrent. signature means return type
as well as no. of parameters.

Is This Answer Correct ?    4 Yes 1 No

What is function overloading?,describe it with the example...

Answer / yasir

OverRIDING:
Signature remains the same, the implementing class just writes its own functionality.
int addition(int a, int b)
{
int c;
c = a * b;
return c;
}
changes to
int addition(int a, int b)
{
c = (a + b)*(a-b);
return c;
}
OverLOADING:
Signature changes, but the return type remains the same.

int addition(int a, int b);
changes to
int addition(int a, int b, int prevResult);

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More OOPS Interview Questions

When will a constructor executed?

5 Answers   TCS,


i had specified the access specifier for abstarct class member like (pure virtual function) as private.But it can be accessed by the derived class.How the private member of one class is accessed by other class.if any body face this problem and found the solution plz reply to me.

1 Answers   Syntel,


Can we call a base class method without creating instance?

6 Answers  


What is pure oop?

0 Answers  


How can you overcome the diamond problem in inheritance?

0 Answers   NIIT,


tell about copy constructor

3 Answers   Siemens,


What is deep and shalow copy?

3 Answers   L&T, TCS,


How to use CMutex, CSemaphore in VC++ MFC

0 Answers   Persistent, TCS,


What is difference between data abstraction and encapsulation?

0 Answers  


Program to check whether a word starts with a capital letter or not.

1 Answers   Infosys,


In multilevel inheritance constructors will be executed from the .... class to ... class

2 Answers   ABCO, TCS,


explain dynamic binding by drowing

2 Answers   Cognizant,


Categories