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 object and example?
Can we create object of abstract class?
What do you mean by variable?
write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.
Explain the advantages of inheritance.
What does and I oop mean in text?
can inline function declare in private part of class?
Write a program to sort the number with different sorts in one program ??
How do you define social class?
What is encapsulation process?
What is advantage of inheritance?
Which is not an object oriented programming language?
Is abstract thinking intelligence?
Why do we use polymorphism in oops?
What is the difference between a mixin and inheritance?