Operator Overloading

Some object oriented languages, notably C++, allow you to not only overload methods but also operators like + or -. This is very useful when dealing with user defined mathematical classes like complex numbers where + and - have well-defined meanings.

However most non-mathematical classes do not have obvious meanings for operators like + and -. Experience has shown that operator overloading is a large contributor to making multi-person programming projects infeasible. Therefore Java does not support operator overloading.

Previous | Next | Top | Cafe au Lait

Copyright 1997 Elliotte Rusty Harold
Last Modified July 22, 1997