Understanding Java 10: Key Features for Simplified Coding
Java, a well-known programming language, has been a part of the coding world for years, adapting and growing with each new version. In…
Understanding Java 10: Key Features for Simplified Coding

source: tatvasoft.com
Java, a well-known programming language, has been a part of the coding world for years, adapting and growing with each new version. In March 2018, Java 10 was released, introducing several important upgrades that made programming easier, faster, and more efficient. Let’s explore the major features of Java 10 in simple words, so you can understand and utilize them in your coding adventures.
Local-Variable Type Inference (var)
One of the biggest changes in Java 10 is the introduction of var. This allows you to declare a variable without specifying its type. The compiler understands the type based on the value you assign to the variable.
var list = new ArrayList<String>(); // infers ArrayList<String>
var stream = list.stream(); // infers Stream<String>
Before Java 10, you would need to write the full declaration, like ArrayList<String> list = new ArrayList<String>();, which is repetitive. Now, your code is cleaner and you don't have to repeat yourself.
Application Class-Data Sharing (CDS)
The Application Class-Data Sharing (CDS) feature helps to improve startup time and reduce memory footprint running Java applications. It allows you to share class metadata between different Java processes.
To use it, you first need to create a list of all the classes your application will use. You can do this by running your Java application with the -XX:+UseAppCDS option.
Time-Based Release Versioning
Java 10 introduced a new time-based versioning format. The new format is YY.M (Year.Month), which is easier to understand. This change means that new Java versions are planned to be released every six months, ensuring that developers can access new features more quickly.
Garbage-Collector Interface
This isn’t something you use in your day-to-day coding, but it’s good to know. Java 10 improves the code isolation of different garbage collectors by introducing a clean garbage collector (GC) interface. This simplifies the addition of a new GC without altering the rest of the codebase.
Parallel Full GC for G1
The G1 garbage collector was made the default in Java 9. In Java 10, they improved it with enhanced performance for full garbage collections. Full GCs are now done in parallel, which speeds up the GC process and reduces pauses, making your applications run smoother.
Heap Allocation on Alternative Memory Devices
This feature allows the HotSpot VM to allocate the Java object heap on an alternative memory device, such as an NV-DIMM, specified by the user. You can use this feature by using the -XX:UseNUMA -XX:+UseG1GC options, which can help achieve better performance when you have memory-intensive applications.
Thread-Local Handshakes
A new way to perform a callback on threads without performing a global VM safe-pointing. This means that the VM can stop individual threads and not just all of them. It’s a technical improvement that makes your Java applications run more efficiently by reducing the impact of stopping threads for operations like garbage collection.
Remove the Native-Header Generation Tool (javah)
Java 10 got rid of the javah tool because it was outdated. The javac tool now includes the functionality of javah, generating header files when needed, which simplifies the Java development process.
Before Java 10, you would need to use javah to generate header files for native methods. Now, javac does it automatically for you.
// Old way with javah
// $ javah -jni MyClass
// New way, no need for javah
// Just compile your Java code and headers will be generated
// $ javac MyClass.java
Additional Unicode Language-Tag Extensions
Java 10 supports additional Unicode extensions, which means you have more control over the culture-dependent behaviors in your Java applications. It includes language and script extensions like u-nu-thai for specifying numbers in Thai.
Root Certificates
Java 10 now comes with a set of root certificates that make it easier to use out-of-the-box for TLS (Transport Layer Security) connections. You no longer have to manually add them, which reduces the hassle of setting up secure connections.
Consolidate the JDK Forest into a Single Repository
This is a change behind the scenes. Before Java 10, the JDK source code was in different repositories, making it hard to manage. Now, it’s all in one place, which simplifies development for the JDK developers and those who want to build the OpenJDK themselves.
Understanding these new features of Java 10 will help you code more effectively. The var keyword alone significantly simplifies your coding experience and helps you write cleaner code. Remember, the purpose
메타데이터
- post_id
- 95b3c7fe345a
- slug
- understanding-java-10-key-features-for-simplified-coding-95b3c7fe345a
- url
- https://medium.com/@naveen-metta/understanding-java-10-key-features-for-simplified-coding-95b3c7fe345a
- canonical_url
- https://medium.com/@naveen-metta/understanding-java-10-key-features-for-simplified-coding-95b3c7fe345a
- author_url
- https://medium.com/@naveen-metta
- status
- ok
- fetched_at
- 2026-07-22 01:48:56