What is function overloading and operator overloading?
Answer Posted / jerry
function overloading - function name will be same but
operation will be different for eg:
if we take the function as area
then 1. area(int x,int y)
2. area(int x);
these r the two functions with the same name but
they will differ by their arguments given
for the 1st function
it becomes the area of the rectangle=x*y
for the 2nd function it becomes the area of square=x*x
coming to the operator overloading,
it is an overloading function of an operator.
if we + as an operator
a+b then + is operator for the operands a,b
c+d then + is also an poperator for the c,b.
these r the two properties of polymorphism.
| Is This Answer Correct ? | 53 Yes | 12 No |
Post New Answer View All Answers
What is class in oop with example?
What is a class in oop?
What is an example of genetic polymorphism?
What do you mean by overloading?
which feature are not hold visual basic of 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 is coupling in oops?
write a programe to calculate the simple intrest and compund intrest using by function overlading
What does <> mean pseudocode?
What are oops functions?
What is destructor oops?
write a program that takes input in digits and display the result in words from 1 to 1000
How can you overcome the diamond problem in inheritance?
How do you achieve polymorphism?
How is polymorphism achieved?