This tutorial teaches the basics of Java’s local variable type inference, specifically where you can and can’t use var in your code.

Java is changing rapidly, and with the six-month release cycle, we are getting new features to try with every release. In Java 10, local variable type inference was added. It was basically aimed at reducing boilerplate code and improving readability when declaring local variables with initializers.

Programs must be written for people to read and only incidentally for machines to execute

Harold Abelson

#java #tutorial #java 10 #var #local variable type inference #local variable type inference: declare var, not war

Local Variable Type Inference: Declare Var, Not War
1.50 GEEK