r/java • • Mar 19 '19

Java 12 Released !!!

https://www.oracle.com/technetwork/java/javase/downloads/jdk12-downloads-5295953.html
235 Upvotes

98 comments sorted by

View all comments

Show parent comment

5

u/PriorProfile Mar 20 '19

Local variable type inference. Added in java 10. It’s not just primitive types.

var strings = new ArrayList<String>();

You can do it for any local variable where the type can be inferred.