Postingan

Menampilkan postingan dengan label Java 10

Finally, Java 10 has var to declare Local Variables - JDK 10 New Feature

Gambar
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...

10 JDK 10 Features Java Developers Should Know

Gambar
Hello Guys, while we all are talking about Java 9 and some people are yet to adopt Java 8 in their projects, here comes the new release of Java, the JDK 10. It's available to download now on Oracle's website. This is the first release in the latest release schedule, where you have a new Java release every six months, I know it's quite early, but that's a reality now. Apart from 6 monthly release, Every 3 years there is an LTS release, which is sort of major Java release. The next LTS release is Java 11 which should be out in September. So you can aim for that. Then you can update three years after that to the next LTS release. 10  Java 10 Features Developer Should Know Even though JDK 10 looks come really quick, there are some interesting features coming in JDK 10. I have yet to go into the details of that but on prima-facia they look useful and interesting to me. Here is a quick note on those features: 1. Local Variable Type Inference (JEP 286) Similar to Javascript, K...