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
How do you achieve runtime polymorphism?
What is class and object with example?
What is overloading in oops?
What is and I oop mean?
There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.
Give two or more real cenario of virtual function and vertual object
How to hide the base class functionality in Inheritance?
What are two types of polymorphism?
Are polymorphisms mutations?
how to get the oracle certification? send me the answer
What is new keyword in oops?
write string class as your own class in java without using any built-in function
What are the 5 oop principles?
What is the use of oops?
What is encapsulation example?