user3374795
user3374795

Reputation:

Does Java8 supports operator overloading

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

void operator(){ }

in C++?

Upvotes: 4

Views: 2670

Answers (1)

Stefan Winkler
Stefan Winkler

Reputation: 3966

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

Upvotes: 6

Related Questions