What is operator overloading? Give Example

Answer Posted / riya piyush jain

Operator overloading (less commonly known as operator ad-
hoc polymorphism) is a specific case of polymorphism in
which some or all of operators like +, =, or == have
different implementations depending on the types of their
arguments. Sometimes the overloadings are defined by the
language; sometimes the programmer can implement support
for new types.

Is This Answer Correct ?    23 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer

1623


Why we use classes in oop?

585


What is inheritance in simple words?

627


what is different between oops and c++

2005


when to use 'mutable' keyword and when to use 'const cast' in c++

1651






What is overloading and its types?

619


Can a varargs method be overloaded?

619


Why do we use inheritance?

630


Whats is abstraction in oops?

593


write a program that takes input in digits and display the result in words from 1 to 1000

1994


Is oop better than procedural?

576


What is the important feature of inheritance?

637


Why do we use class in oops?

557


What type of loop is a for loop?

686


What is abstraction encapsulation?

663