Operator overloading in Java

前端 未结 10 1752
独厮守ぢ
独厮守ぢ 2020-11-21 23:51

Please can you tell me if it is possible to overload operators in Java? If it is used anywhere in Java could you please tell me about it.

10条回答
  •  醉话见心
    2020-11-22 00:25

    You can't do this yourself since Java doesn't permit operator overloading.

    With one exception, however. + and += are overloaded for String objects.

提交回复
热议问题