Back to Java Questions Index

Cosmic Q&A

Does Java support operator overloading?

Answer

Java does not support operator overloading like C++. We have to write methods that perform actions instead of operators. For instance if we want to add two Complex numbers c1 and c2, our implementation in Java will be something like c1.Add(c2) instead of c1 + c2.


Share this page:

Report Error in Content