2 ms·
Local type inference[1] means you can write: var foo = new Map<String, String>(); The static initialisation methods on collections[2] let you write var f
by andystanton 8y ago
Local type inference[1] means you can write:
var foo = new Map<String, String>();
The static initialisation methods on collections[2] let you write
var foo = List.of(1, 2, 3);
It's still clunkier than many newer languages but it is improving.
1. https://developer.oracle.com/java/jdk-10-local-variable-type-inference https://developer.oracle.com/java/jdk-10-local-variable-type...
2. https://docs.oracle.com/javase/9/docs/api/java/util/List.html#of-- https://docs.oracle.com/javase/9/docs/api/java/util/List.htm...