What is function overloading?,describe it with the example.
Answer Posted / 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 View All Answers
What is static modifier?
What are two types of polymorphism?
Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box
Why do we use class?
What is the important feature of inheritance?
What are the 3 pillars of oop?
How can you overcome the diamond problem in inheritance?
What is the full form of oops?
Can a varargs method be overloaded?
hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.
What is use of overloading?
What is polymorphism what is it for and how is it used?
What is pointer in oop?
How to use CMutex, CSemaphore in VC++ MFC
How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction