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

What is the difference between a mixin and inheritance?

0 Answers  


write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.

0 Answers   Microsoft, TCS,


in the following, A D B G E C F Each of the seven digits from 0,1,2,3,4,5,6,7,8,9 is: a)Represented by a different letter in abov fig: b)Positioned in the fig abov so tht A*B*C,B*G*E,D*E*F are equal. wch does g represents? C

1 Answers   IonIdea,


What are the three main types of variables?

0 Answers  


Which language is pure oop?

0 Answers  






What is design patterns in C++?

2 Answers   Persistent,


What is a friend function & its advantage?

1 Answers   MIT,


Precompilation ?

1 Answers   emc2,


There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.

0 Answers  


what type of question are asked in thoughtworks pair programming round ?

0 Answers   Thought Works,


write a c++ code of diagonal matrix.

2 Answers  


What are classes oop?

0 Answers  


Categories