O'Reilly logo

From Java to C#: A Developer's Guide by Heng Ngee Mok

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 22. Operator overloading

Operator overloading is a feature of C++, which has (unfortunately or fortunately [1]) been removed from Java. What you can do with operator overloading can be performed with common methods – in fact you define an operator overload using a method itself. Hence, I will not classify operator overloading as an important or essential feature of C#, but rather one which gives good developers more choice and flexibility.

[1] It is unfortunate because operator overloading is a convenient feature which makes programming more elegant. It is fortunate because since it is not an important feature – you can duplicate operator overloading functionality using normal methods – not including it in Java makes it an easier language ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required