Operator Overloading
Operator Overloading
S.S.R.K.M.GUPTA
Expression :
An expression is a statement which
has the combination of operators and
operands arranged in a meaningful
way.
Operator overloading:
Operator overloading is a concept
and it is a type of polymorphism
which provides to build expressions
using objects as objects.
Operator overloading
Generally we can use operators with predefined data
types only, while constructing the expressions.
i.e., the operations of a particular operator is limited
to (or) restricted to predefined data types only.
So, we cannot write expressions with user-defined
data types as operands.
Operator overloading facilitates us to extending the
operation for user defined data types also.
Providing additional functionality for an operator,
working with user defined data types or objects is
known as operator overloading.