“I bought this guide a few days ago to prepare for my interview with Oracle. Many of the questions they asked me were from this guide. I found this book absolutely great!”
When an operator is overloaded, it takes on an additional meaning relative to a certain class. But it can still retain all of its old meanings.
Examples:
1) The operators >> and << may be used for I/O operations because in the <iostream> header, they are overloaded.
2) In a stack class it is possible to overload the + operattor so that it appends the contents of one stack to the contents of another. But the + operator still retains its original meaning relative to other types of data.
Also Polymorphism can be achieved in C++ through operator overloading
Operator overloading is all about syntax. You can have your class give its own implementation for an operator, so that your class types more closely resemble the built-in types.
For example, if you have an iterator class, you can overload operator++ to iterate to the next element, rather than have a function named something like “Next”.
Submitted By: Saroj Kanta Behera — October 27, 2006
operator overloading is a type of function.which provide a numericale function like
operator ==(object a ,object b)
it compaire two object
operator meaning is not change
When an operator is overloaded, it takes on an additional meaning relative to a certain class. But it can still retain all of its old meanings.
Examples:
1) The operators >> and << may be used for I/O operations because in the <iostream> header, they are overloaded.
2) In a stack class it is possible to overload the + operattor so that it appends the contents of one stack to the contents of another. But the + operator still retains its original meaning relative to other types of data.
Also Polymorphism can be achieved in C++ through operator overloading
Operator overloading is all about syntax. You can have your class give its own implementation for an operator, so that your class types more closely resemble the built-in types.
For example, if you have an iterator class, you can overload operator++ to iterate to the next element, rather than have a function named something like “Next”.
operater overloading is a Mechanism which is able to manuplate the predefine operater like +,*,-,++etc.with the user define object.
operator overloading
Is the term used to describe the definition of a new function that has already been defined earlier, giving it a different parameter list
operator overloading is a type of function.which provide a numericale function like
operator ==(object a ,object b)
it compaire two object
operator meaning is not change
operator are +,++,-,–,=,== etc
Leave an Answer/Comment