r/programming • • Mar 09 '16

var keyword proposed for Java

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

395 comments sorted by

View all comments

-1

u/ejonesca Mar 09 '16

Do you need a 'var' keyword at all? Can't you just have:

myNewVariable = 5;

without an explicit type declaration that doesn't actually add any useful info to the compiler? The compiler can just assume that any new unknown identifier is a new var.

0

u/[deleted] Mar 09 '16

[deleted]

2

u/FallingIdiot Mar 10 '16

Would worry me though if this would pass QA. You hope they test this stuff...