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 ...

Get From Java to C#: A Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.