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

43

u/solatic Mar 09 '16

Good idea. Hey, let's also introduce val as the equivalent of final var while we're at it, to promote immutability.

Why not?

1

u/eliasv Mar 10 '16

var and final var already capture it pretty well, and considering "effectively final" is already something the compiler figures out by itself, I don't see the benefit in requiring people to use a different reserved name. In most circumstances the compiler will see var as final var anyway.

→ More replies (1)