Few days ago the Belgian Java Users Group (BeJUG) and the Brazilian Java Users Group (SouJava) jointly discussed a submission of few new features as language JSR for JDK7 in the Java Community Process. Lot of small nice features were introduced but one thins was still missing.
Implicit Variable Declarations
The implicit variable declarations with “var” keyword (like in C# 3.0) can significantly reduce the ammount of code developers write every day. For example the code below:
could be simplified to:
We could use even more interesting constructs like this:
The type of the “entires” and “entry” variables is implicitly defined from the right side of the expressions in the above code so we don’t want to write the boring and long type definition.
Nice! I am very happy to see this in C# 3.0. Why not in Java 7 too? What do you think?