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 interface? When and where is it used?
write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory
Can main method override?
What are the 5 oop principles?
What is overloading in oop?
Is react oop?
What makes a language oop?
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.
What do you mean by variable?
just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.
What is polymorphism explain its types?
How does polymorphism work?
What is ambiguity in inheritance?
What is class and object in oops?
How long to learn object oriented programming?