TOP JAVA 10 FEATURES

Oracle announced a new version of Java which turned out to be the speediest one for its feature release of the Java SE platform, till now. This is the first release in the newest release schedule, where you get a new Java release after every six months. It has decided to promote Open JDK binaries as primary JDK 10 which reduces the hassle for the big companies to shuffle from the current system every time, a new version is enhanced in every java release. Some of the key highlights in the new java release include application class-data sharing, heap collection as well as local variable types. A few of the prominent new Java 10 features are listed below:

1. Local Variable Type Inference

It is one of the newest Java 10 features for developers. Type inference is Java compiler’s ability to look at each method invocation and corresponding declaration of local variables to determine the type argument or multiple arguments that make the invocation applicable. Local Variable meaning ‘var’ is not a keyword, but it is a reserved type name in the Java Language. So it cannot be used as a method, package, class or interface. Its uses are defined such as:

  • Limited only to Local Variable with an initializer
  • Indexes of enhanced for loops or indexes
  • Local declared in for loop

Let us walk through an example:

var numbers = List.of(1, 2, 3, 4, 5); // inferred value ArrayList<string>
// Index of Enhanced For Loop
for (var number : numbers) {
     System.out.println(number);
}
// Local variable declared in a loop
for (var i = 0; i < numbers.size(); i++) {
      System.out.println(numbers.get(i));
}
</string>

2. Parallel Full GC for G1

With the new Java 10 features updated now, source code isolation of different garbage collectors can be improvised with the coming of the new and most common Garbage Collector Interface. It emphasizes on providing better modularity to the internal GC code which in future, will help for adding full garbage collection without changing existing codebase. Also it helps in removing or maintaining the previous GC Parallel.

3. Additional Unicode Language –Tag Extensions

It will enhance the java.util.Locale and related APIs to implement additional Unicode extensions of BCP 47 language tags. This added the support for the below mentioned additional extensions –

  • cu (currency type)
  • fw (first day of the week)
  • rg (region override)
  • tz (time zone)

4. Thread – Local Handshake

A handshake operation is a callback that is executed for each Java Thread while that thread is in a safe point safe state. The callback is implemented by the VM thread while keeping the thread in a blocked state or by the thread itself. It allows executing a callback on threads without performing a global VM safe-point. It is possible and also cost-effective to stop individual threads and not just all threads or none.

5. Heap Allocation on Alternative Memory Devices

Applications such as in-memory databases and big data have an increasing demand for memory. Such applications could use NV-DIMM for the heap since NV-DIMMs has a larger capacity, at lower cost, in comparison to DRAM.Heap Allocation feature enhances the capability of Hotspot VM by allocating the Java object heap on an alternative memory device, such as an NV-DIMM as specified by the user. It also targets alternative memory devices that have the same semantics as a DRAM, including the semantics of atomic operations, and can be used instead of DRAM for the object heap to the existing application code without any change.

6. Root Certificates

Java 10 promotes Open JDK binaries as primary binaries for the ease of using the system without needing to update it frequently.

The cacerts Keystore will be inhabited with a kit of root certificates issued by the CAs of Oracle’s Java SE Root CA Program. Critical security components like TLS will run by default in OpenJDK builds moving forward.

To ensure the integrity and confidentiality, It comprises a default set of root Certification Authority (CA) certificates in the JDK 10 which makes sure that both Oracle JDK 10 & Open JDK binaries will function the same.

7. Application Class – Data sharing

While initiating JVM, it performs some preliminary steps, one of which is loading classes in memory. If there are multiple jars having several classes, then the lag in the first request is simply visible. There arises a problem with serverless architecture, where the boot time is critical. In order to carry forward the application startup time, Application class-data sharing is used that enables the bootstrap class loader to load classes that have been archived. It is to reduce footprint by sharing common class metadata across several Java processes.

8. Removal of the Native-Header Generation Tool – Java

It allows removing javah tool from JDK 10. It is not mandatory to remove – it is optional. The tool functionality of javad is added in JDK 8, which helps to generate native header files when compiling JNI code without using javah.

9. Consolidate the JDK Forest into a Single Repository

For a long time, for Java development, several repositories were utilized for the JDK forest codebase. Multiple repositories do provide several advantages, but it also comes with various operational downsides. It helps to combine the numerous repositories of the JDK forest into a single repository for streamlining the development process.

10. Experimental Java-Based JIT Compiler

Graal, as defined in Java 9, is an alternative to the JIT compiler which has been used to plugin to the JVM, meaning that the JIT compiler is not attached with JVM and can be dynamically plugged in or replaced with any other plugin. It also introduces Ahead of Time (AOT) compilation in java. It also supports the interpretation of the polyglot language. This feature enables the Java-based JIT compiler, Graal, to get used as an experimental JIT compiler on the Linux/x64 platform.

11. Time-Based Release Versioning

Time-based release versioning improves the version-string scheme of the Java SE Platform and the JDK 10, and similar versioning data, for today and upcoming release models.

Ending the Line

Overall, it seems that JDK 10 updates provide supportive new features to the java community. It also modifies or merges the features from the older version. By this enhancement, now Java developers have the privilege to code with less time complexity and efficiency. Yet, it also helps the developers to work less on some features and reduce the time complexity.

profile-image
Vishal Shah

Vishal Shah has an extensive understanding of multiple application development frameworks and holds an upper hand with newer trends in order to strive and thrive in the dynamic market. He has nurtured his managerial growth in both technical and business aspects and gives his expertise through his blog posts.

Related Service

Know more about Java Development services

Learn more

Want to Hire Skilled Developers?


    Comments

    • Leave a message...

      1. Kanvi

        This is one of the most informative and well-written blog posts I've read on Java 10 features. All the Java 10 features are described in detail in this article. It is helpful to anyone who is new to Java and wants to explore Java.

      2. Shyla

        Thanks for sharing this informative article. I particularly liked the feature of local variable-type inference. This is a strong new feature that can make code more clear and easier to read. I'm looking forward to trying it out on my own projects.

      3. Marco

        After reading your article, I thought your blog post was a great overview of the new features in Java 10. The data looked accurate and properly presented. I would recommend it to anyone who is interested in learning more about Java 10.

      4. Aahan

        As a Java developer, staying up-to-date with the latest version of the language is necessary, and your article has provided a clear overview of the new features introduced in Java 10. Thanks for sharing!

      5. Keyur

        Some prominent new Java 10 features are very well explained in this article. This information is extremely helpful to me as a Java developer. Keep Sharing!

      6. Luca

        Thanks for sharing! This Blog provides a concise and informative overview of the new features and improvements introduced in Java 10. It helps me to understand how these features can be used in my own projects.

      7. Ziva

        I am exploring Java 10 and this article help me a lot. JDK 10 updates provide supportive new features to the java like class-data sharing, heap allocation, local variable types, Thread – Local Handshake etc. Thanks for such an informative blog!