Java 10 new features


Java 10 is realased, what are its new features ?

Given the new schedule from Java, there should be a new release for Java in every six months. This March 2018, JDK 10 was released, being the first release of the said schedule. This Java 10 release has some interesting features that came with it and here are as follows:

Local-Variable Type Inference :

Java now has a var keyword allowing you to declare a local variable not requiring you to specify its type, just like in Scala, Kotlin, and JavaScript. The type will then just be inferred from context. To give you an example, let’s say var name = “Java”, the compiler will already know that the type is String. Please take a note that this kind of variables can only be used as local variables inside a method and not class members.

Garbage Collector Interface :

Considered one of the most interesting and useful features from Java 10 release, it improves the source code isolation of different garbage collectors through the introduction of a clean garbage collector (GC) interface.

Parallel Full GC for G1 :

This feature improves G1 worst-case latencies by creating the full GC parallel. Reviewing the release of Java 9, the default GC used for the JVM was G1 which was designed just to avoid full GC. Until the concurrent collections could no longer reclaim memory that quick, ending up on a full GC creating a problem.

Heap Allocation on Alternative Memory Devices :

With this JDK 10 feature, HotSpot VM is enabled to allocate the Java object heap on an NV-DIMM or other alternative memory devices which are specified by the user. Simply, assigning lower priority processes to use the NV-DIMM memory is made possible and not only allocating higher priority processes to the DRAM in an environment that is multi-JVM.

It's clear that these features are not the only ones that Java 10 offers, can you mention any other feature you know in the comments below.



Boostlog is an online community for developers
who want to share ideas and grow each other.

Delete an article

Deleted articles are gone forever. Are you sure?