Java 10 is the most accelerated release of a Java version in its 23-year history. Java has been criticized for its slow growth and evolution, but Java 10 just went against that concept. This is a release with many developments, the range, and impact of which may not be visible but are far fetching. Here in this article, we will look for some critical Java 10 Features
The new Java 10 feature will add some syntactic sweetness to Java, analyzing it and improving the developer’s experience. It will reduce the excessive use of words associated with writing Java while maintaining the commitment to inactive type safety.
Java 10 consists of various new features and improvements into many functional areas. Some of its important enhancements include advancements for garbage collection and compilation as well as local variable types.
Java 10 Features
- JEP 286: Local Variable Type Inference
- JEP 322: Time-Based Release Versioning
- JEP 304: Garbage-Collector Interface
- JEP 307: Parallel Full GC for G1
- JEP 316: Heap Allocation on Alternative Memory Devices
- JEP 296: Consolidate the JDK Forest into a Single Repository
- JEP 319: Root Certificates
- JEP 317: Experimental Java-Based JIT Compiler
- JEP 312: Thread-Local Handshakes
- JEP 313: Remove the Native-Header Generation Tool
The peculiarity of Java 10 features
- For achieving a callback on threads without conducting a global VM safe-point, there is a feature of thread-local handshakes.
- Application class-data sharing: Used to decrease the footprint by sharing common class metadata across methods. Also, the startup time is adjusted.
- They are facilitating the Grall Java-based just-in-time compiler which is to be used in an innovative form on the Linux/x64 platform.
- The requirement of parallel full garbage accumulation for the G1 garbage specialist to develop a mean case latency by executing parallelism.
- To improve the source-code privacy of different garbage collectors, there is a provision of a clean garbage collector interface. This proposal is striving for better modularity for internal garbage collection code in the HotSpot virtual machine and thus making it accessible to attach a new garbage collector to HotSpot.
- New APIs for the betterment of enabling the creation of unmodifiable collections. The Set.copyOf, copy, and Map.copyOf methods will create new collection instances from existing instances. New methods such as to UnmodifiableMap, to UnmodifiableList, and to UnmodifiableSet were added to the Collectors class in the Stream package which will permit the components of a Stream to be assembled into an unmodifiable array.
- There will be quicker startup times for the jShell REPL tool mainly when a start file with many pieces is in use.
- Three new JVM options will be available to give Docker container users greater control over system memory.
- Local variable type inference: Will intensify the language to extend type inference to local variables. The purpose is to reduce the “ceremony” linked with coding while preserving a commitment to inactive type security.
- Graal, an innovative just-in-time compiler, can be applied on the Linux/x64 platform.
- With the help of HotSpot, it will permit to designate the object heap on an alternative memory device like NVDIMM memory module as stipulated by the user. Due to this characteristic, it is anticipated that future systems may have complex memory architectures.
The Java team at Oracle states that it will not be possible for:
- Method parameters
- Constructor parameters
- Method return types
- Catch formals (or any different kind of variable declaration).
The evolution of new Java versions was, up until now, very feature driven. It implied that you had to wait for a few years for the next release. Significant developments like Generics, Lambdas, Streams, and Jigsaw made this fact bearable, but quite a lot of the smaller and beneficial language improvements were consistently delayed this way.
Due to Java’s responsibility to support previous versions of Java, we can assume it won’t break backward harmony.