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
Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)
What is polymorphism in oop example?
officer say me - i am offered to a smoking , then what can you say
What is the highest level of cohesion?
What is oops concept with example?
Describe these concepts: Polymorphism, Inheritance and Abstraction.
What are objects in oop?
What is the significance of classes in oop?
What is data binding in oops?
Why do pointers exist?
What is polymorphism what are the different types of polymorphism?
What does sksksk mean in text slang?
How oops is better than procedural?
How to hide the base class functionality in Inheritance?
What is use of overloading?