Does Java8 supports operator overloading

懵懂的女人 提交于 2019-12-23 16:24:31

问题


So I'm interested is there a way to overload operator in Java 8? Is there exist something like

void operator(){ }

in C++?


回答1:


No, there is no operator overloading in Java 8. If you don't know it yet, you could have a look at Xtend which is a JVM language that compiles to pure Java. It supports operator overloading and a lot more features while it's still has a static type system.

(And, of course, there is Groovy, Scala, and other JVM scripting languages which support operator overloading as well).



来源:https://stackoverflow.com/questions/23782289/does-java8-supports-operator-overloading

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!