Finally, Java 10 has var to declare Local Variables - JDK 10 New Feature
Hello guys, In this series of new features of Java 10 articles, today,s I am going to talk about probably the most popular and most useful, the introduction of var keyword (well, it's not really a keyword but I'll you later about it) in Java. If I am not wrong, this feature was supposed to come on Java 9 but dropped later. Finally, Java also has var keyword to declare variables which allows you to declare a variable without their type e.g. instead of doing String str = "Java" you can now just say var str = "Java". This may not sound much gain when declaring String or an int variable but consider about complex types with generics, this will surely save a lot of typing and also improves the readability of code. Java developers have long been complaining about boilerplate code and ceremonies involved while writing code. Many things which take just 5 minutes in languages like Python, Groovy, or JavaScript can take more than 30 minutes in Java due to its verbosit...