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

difference between overloading and overridding

11 Answers  


Why multiple inheritance is not allowed?

0 Answers  


write a short note on Overloading of Binary Operator?

2 Answers  


what is different between oops and c++

0 Answers   IIT,


Question: Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid “time and a half”, that is, 150 percent of the hourly rate on the hours exceeding 40. Be sure to use stepwi se refine ment and break your solution into several functions. Use the int_name function to print the dollar amount of the check.

0 Answers  






write a program to find 2 power of a 5digit number with out using big int and exponent ?

0 Answers  


What is inheritance in simple words?

0 Answers  


Difference between new operator and operator new

2 Answers  


What is polymorphism what is it for and how is it used?

0 Answers  


WHAT IS THE DIFFERENCE BETWEEN OBJECT BASED & OBJECT ORIENTD PROGRAMMING LANGUAGE.(GIVE AT LIST 4 PIONT)

1 Answers   TCS,


what are three tenets of object orinted Systems?Why they call like that ? Please answer me. Advance thanks.

2 Answers   Excel,


What does and I oop mean in text?

0 Answers  


Categories