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
Where You Can Use Interface in your Project
Why is polymorphism used?
How do you achieve runtime polymorphism?
What is abstraction in oop with example?
What are the 3 pillars of oop?
What is the purpose of polymorphism?
What are constructors in oop?
Why do we use class?
What is encapsulation in simple terms?
Write a c++ program to display pass and fail for three student using static member function
Can you inherit a private class?
What is destructor in oop?
What is polymorphism in oops with example?
Plese get me a perfect C++ program for railway/airway reservation with all details.
hi all..i want to know oops concepts clearly can any1 explain??