You can override operators, but they might not do what you want . The reason is that operators (actually overloads in general) are selected from the static type of an object. If you now have a reference-to-base which is bound to a derived instance, it will not call the operator for the derived class.
Read moreWhat is operation overriding in Java?
In any object-oriented programming language, Overriding is a feature that allows a subclass or child class to provide a specific implementation of a method that is already provided by one of its super-classes or parent classes .
Read moreWhich operators Cannot be overridden?
Operators which cannot be overloadedEdit
Read moreCan you override an operator in Java?
You cannot do this in Java. You’d have to implement a plus or add method in your Point class.4 Ara 2011
Read more