1
JavaIntermediate#inner-classes
var lets the compiler infer the local variable's type from the initializer at compile time; it's still statically typed, not dynamic. It can only be used for local variables with an initializer, not fields or method parameters.
var list = new ArrayList<String>(); // inferred as ArrayList<String>
list.add("hi");
// var x; // error: no initializer to infer from