Fundamentals 9 min read

What’s New in Java 10? Top 10 Features You Need to Know

This article reviews Java 10’s major enhancements—including local‑variable type inference, time‑based release cadence, new garbage‑collector interfaces, parallel G1 GC, heap‑allocation on alternative memory devices, repository consolidation, default root certificates, experimental Graal JIT, ThreadLocal handshakes, and removal of the javah tool—highlighting their impact for developers.

21CTO
21CTO
21CTO
What’s New in Java 10? Top 10 Features You Need to Know
21st Century Tech Officer Guide: Java 10 has been released, bringing type inference, garbage collection improvements, and many other important updates.

Although many are still discussing Java 9 and some have not yet adopted Java 8, JDK 10 is now available for download from Oracle’s website. This is the first release under Oracle’s new six‑month cadence, with a new LTS version (Java 11) scheduled for September.

1. Local‑Variable Type Inference (JEP 286)

Java now supports the var keyword, allowing developers to declare a local variable without explicitly specifying its type, similar to JavaScript, Kotlin, and Scala.

For example: var name = "Java"; The compiler infers that name is of type String. The var keyword can only be used for local variables inside methods or code blocks, not for class fields, and it does not make Java a dynamically‑typed language.

Using var can reduce boilerplate when dealing with complex generic types, e.g.: var list = List.of(1, 2.0, "3"); Here list is inferred as <? extends Serializable & Comparable<..>>, an intersection type.

2. Time‑Based Release Cadence (JEP 322)

With JDK 10, Java adopts a six‑month release cycle. Every three years an LTS (Long‑Term Support) version is released; the next LTS will be Java 11, expected in September.

Subsequent updates will follow the six‑month cadence, e.g., JDK 10.0.1 in April 2018 and JDK 10.0.2 in July 2018.

3. Garbage‑Collector Interface (JEP 304)

This feature introduces a clean interface for different garbage collectors, making it easier to add or remove GC implementations without affecting the code base.

4. Parallel Full GC for G1 (JEP 307)

Parallel full GC improves G1’s worst‑case latency by using the same number of threads as concurrent collections, reducing performance penalties when G1 falls back to a full GC.

5. Heap Allocation on Alternative Memory Devices (JEP 316)

HotSpot can allocate Java object stacks on user‑specified alternative memory devices, such as NV‑DIMM, allowing lower‑priority processes to use this memory while higher‑priority processes use DRAM.

6. Consolidate JDK Code Repositories (JEP 296)

The many Mercurial‑managed JDK repositories are merged into a single repository, simplifying development and management.

7. Root Certificates (JEP 319)

Java 10 provides a default set of root certificate authorities, reducing differences between OpenJDK and Oracle JDK builds and enabling TLS components to work out‑of‑the‑box.

8. Experimental Java‑Based JIT Compiler (JEP 317)

Graal, an experimental JIT compiler, can be used on Linux/x64 platforms via the following JVM options: -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler Graal serves as the basis for an experimental AOT compiler, but this feature is not yet ready for production use.

9. ThreadLocal Handshakes (JEP 312)

This enhancement allows the JVM to perform callbacks on application threads without a global VM safepoint, enabling selective thread stopping.

10. Remove Native‑Header Generation Tool (JEP 313)

The javah tool is removed; header generation for JNI code can now be done with javac -h.

All these new features are detailed in Oracle’s official release notes, and the JDK 10 binaries can be downloaded from Oracle’s website.

Conclusion

The next Java version, Java 11, is slated for release in September 2018. It will further modularize Java, remove JavaEE and CORBA components, and continue the trend toward a more compact platform.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

JavaperformanceGarbage CollectionJEPvar keywordJDK 10
21CTO
Written by

21CTO

21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.