Java News

Java 10 New Features

What’s New in Java 10 and What are the Future Plans?

Recently Java has changed the pace of releases. Previously, it would take years to come up with a new Java version. But Java 10 was released into the world only six months after Java 9. It seems Oracle is going to try to get new Java versions to developers as soon as possible. Faster release of Java versions means that developers will have access to new features sooner. On the other hand, fast developer adoption will lead to more Java popularity. So, it’s a win-win for both parties.

What’s New?

Here are some of the important Java 10 features:

Local Variable-Type Inference: Java requires explicitly typed variables to ensure “type safety”. It is used as a design principle to minimize runtime errors. However, explicitly typing variables for loop iterators and intermediate values make Java programming time-consuming and error-prone. With local variable-type inference, Java compiler will be able to infer the type of a variable from context. It should speed up programming in Java.

Parallel Full GC for G1 Garbage Collector: Sometimes garbage collection gets priority over running program and the program execution is frozen to give garbage collection exclusive access to the JVM. This is known as “Full Garbage Collection”. In Java 10, this process has been optimized to run parallel threads on multiple processors. It makes the process more efficient.

Application Class Data Sharing: It will optimize startup time and footprint. If a jar doesn’t change, then class-data also doesn’t change. Once the class-data is created, it can be put in an archive and reused across multiple JVMs.

Experimental JIT Compiler: Just-in-time (JIT) compilers help developers write efficient applications. But Java’s JIT compiler was written in C++. The new JIT is Java-based. It will make it easier for developers to maintain the code.

Docker Awareness: Java 10 JVM will know if it is running in a Docker container. Instead of talking to the operating system directly, the JVM will get the information from the Docker container.

Consolidate the JDK Forest into a Single Repository: Various JDK forests are combined into a single repository. It improves housekeeping and streamlines development.

Heap Allocation on Alternative Memory Devices: HotSpot VM will be able to allocate Java object heap on an alternative user-defined memory device.

Root Certificates: JDK 10 is has been developed with the cooperation of OpenJDK. It will provide a default set of root Certification Authorities.

Future Plans

Here are some future considerations for Java:

  • Amber project is helping create productivity-oriented features like local variable-type inference, enhanced enums, and lambda leftovers.
  • Project Panama is working on interconnecting JVM and native code.
  • Project Valhalla is trying to develop major language features for Java 10.
  • Project Loom is focusing on simplifying the development of concurrent applications. It will preserve the general Java threads while improving performance and reducing footprint.

Conclusion

The new fast-paced release cycles mean that features might get pushed to the next release more often than before. But overall, JDK 10 features should be great for everyone.

References:

About the author

Zak H

Zak H

Zak H. lives in Los Angeles. He enjoys the California sunshine and loves working in emerging technologies and writing about Linux and DevOps topics.