Java never fails to create a buzz and as per announcement, the 12th version of Java is out in the market. However, LTS or long-term support is not yet out and therefore, there is yet to be a mass transition to be made. The release date of Java 12 was on 19th March and this is a major release and as with all major releases, there are major updates and features include. As far as Java 12 goes, the following are the features you need to watch out for.

New Garbage Collection – It has become a trend of Java to get some changes in the garbage collection algorithm. This is because Java is renowned for its garbage collection mechanism and since other companies are giving a tough competition, Java wants to be ahead of them all the time. This change is deemed as experimental and Java 13 will probably have a concrete one placed. According to the latest changes, GC will need less time for concurrent execution and the pause time has reduced significantly. The pause time now will be independent of the heap size. The name of the garbage collection is Shenandoah.

JVM Constants API – This is a new introduction and it takes care of the key class-file and run-time artifacts. It basically addresses the loadable constants from the constant pool.

Switch Expression – This is a new makeover on the switch statement whereby it can be used both as a statement as well as an expression. Each of the ways can have traditional and simplified control flow and scope. The changes have been made to simplify coding and use switch more often.

Microbenchmark Suite – This is a completely new suite introduced in Java 12 which most of them are mockingly calling the best feature Java 12 has to produce. It is a basic suite of microbenchmark and its purpose is to make existing microbenchmarks run smoothly and create new ones effortlessly.

Apart from these, there is an abortable mixed collection of G1, default CDS archive and various such small changes here and there.

Other than these, the raw string literals feature has been taken down in Java 12 after receiving so many different complaints from the developers. It is likely to be reintroduced in the next version after sorting out the shortcoming. All in all, you have to say that Java 12 does not really qualify as a major release as there are only a few features added and the rest is just fixing the bugs. But these changes are enough not to make it a minor release. Java 12 will receive commercial support from Oracle for the short-term. This means the support may be discontinued after the release of Java 13.

Kitty Gupta