4

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

void operator(){ }

in C++?

1 Answers1

6

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

Stefan Winkler
  • 3,871
  • 1
  • 18
  • 35