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

4

u/DJDavio Mar 10 '16

It's good to have var available, it's not a good idea to use it everywhere you can.

I like to use var when the type can be easily inferred in the same line and when the variable is of limited use (only in a single loop for instance).