In Java Futures at QCon New York, Java Language Architect Brian Goetz took us on a whirlwind tour of some recent and future features in the Java Language. In this article, he dives into Local Variable ...
Java 10 has introduced a new language keyword var. It allows to define a variable using var and without specifying the type of it. var a = 2; the literal 2 is an int, var is is inferred to be an int.
Before jumping into the concept, lets glance through few terms which might help in understanding the var. When we declare a variable or initialize a variable, it will be holding some type of data. The ...