r/java • • Mar 09 '16

var keyword proposed for Java

http://openjdk.java.net/jeps/286
240 Upvotes

312 comments sorted by

View all comments

Show parent comments

1

u/lukaseder Mar 10 '16

jOOQ uses val() as a method name :) But it's aliased with value() for Scala folks, so it'll be OK. Anyway, I'm sure there are many APIs that might break because of this. But hey, why not add escaping for keywords to the language as well, like in Scala? E.g. void `val`() { ... }

Also: goto is still reserved. Just in case.

2

u/[deleted] Mar 10 '16

[removed] — view removed comment

2

u/lukaseder Mar 10 '16

Me too. But then, I remember break and continue:

here: for (;;) {
    if (doAgain) continue here;
    if (done) break here;
}