Skip to main content

Local Variable Type Inference (var)

Learn Local Variable Type Inference (var) (Java 11 Features, Java) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

1. Introduction Var lets the compiler infer the type of a local variable from its initializer, for example var list = new ArrayList<String>() .

More lessons in Java 11 Features