Starting with Java 10, declaring local variables has been simplified. Developers no longer have to include manifest declarations of local variable types; rather, declarations can be inferred through use of the new var identifier.
Inferring local variables
Inferring declarations with the var identifier
We can use the new var identifier, as with the following example, to infer our data type. So, instead of explicitly declaring data types, we can infer them:
var myList = new ArrayList<String>();
The preceding code infers ArrayList<String>, so we no longer need to use the verbose ArrayList<String> myList = new ArrayList<String>(); syntax.
The introduction of the var identifier should not be construed...