Operator overloading and overriding in Java

Operator overloading and overriding are not supported in Java.

Check following desc quoted from : http://java.sun.com/docs/white/langenv/Simple.doc2.html

2.2.7 No More Operator Overloading

There are no means provided by which
programmers can overload the standard
arithmetic operators. Once again, the
effects of operator overloading can be
just as easily achieved by declaring a
class, appropriate instance variables,
and appropriate methods to manipulate
those variables. Eliminating operator
overloading leads to great
simplification of code.

Leave a Comment