How do you do operator overloading in Java?

No, Java doesn’t support user-defined operator overloading . The only aspect of Java which comes close to “custom” operator overloading is the handling of + for strings, which either results in compile-time concatenation of constants or execution-time concatenation using StringBuilder/StringBuffer.

Sizin İçin Seçtik  Will Java ever have operator overloading?

Leave a Reply

Your email address will not be published. Required fields are marked *