Tuesday, March 13, 2007

Does Java supports "Operator Overloading"?

This was the question which aroused in my mind when for the first time I saw the use of String concatenation operator "+" to concatenate two or more Strings.
To get to its root, I read many articles on forums and blogs [e.g. Sun's Forum] and finally came to the following conclusion:


> String concatenation operator "+" is an exception and is just given for the simplicity and it's used internally by the compiler.
> We cannot overload any of the operator at the language level, so this means that Java doesn't support operator overloading.

Please feel free to CORRECT me in case I am going wrong, that would be very kind of you :-).

No comments:


_________________________________________________________________________________________________________________

"Look at the sky. We are not alone. The whole Universe is friendly to us and conspires only to give the best to those who dream and work."

- Dr. A P J Abdul Kalam
_________________________________________________________________________________________________________________