{"id":123613,"date":"2020-12-28T18:09:31","date_gmt":"2020-12-28T18:09:31","guid":{"rendered":"https:\/\/onet.com.vn\/java-10-new-features.html"},"modified":"2020-12-28T18:09:31","modified_gmt":"2020-12-28T18:09:31","slug":"java-10-new-features","status":"publish","type":"post","link":"https:\/\/onet.com.vn\/java-10-new-features\/","title":{"rendered":"Java 10 New Features"},"content":{"rendered":"\n
\n

What\u2019s New in Java 10 and What are the Future Plans?<\/h1>\n

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\u2019s a win-win for both parties.<\/p>\n

What\u2019s New?<\/strong><\/h2>\n

Here are some of the important Java 10 features:<\/p>\n

Local Variable-Type Inference:<\/strong> Java requires explicitly typed variables to ensure \u201ctype safety\u201d. 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.<\/p>\n

Parallel Full GC for G1 Garbage Collector:<\/strong> 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 \u201cFull Garbage Collection\u201d. In Java 10, this process has been optimized to run parallel threads on multiple processors. It makes the process more efficient.<\/p>\n

Application Class Data Sharing:<\/strong> It will optimize startup time and footprint. If a jar doesn\u2019t change, then class-data also doesn\u2019t change. Once the class-data is created, it can be put in an archive and reused across multiple JVMs.<\/p>\n

Experimental JIT Compiler: <\/strong>Just-in-time (JIT) compilers help developers write efficient applications. But Java\u2019s JIT compiler was written in C++. The new JIT is Java-based. It will make it easier for developers to maintain the code.<\/p>\n

Docker Awareness:<\/strong> 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.<\/p>\n

Consolidate the JDK Forest into a Single Repository: <\/strong>Various JDK forests are combined into a single repository. It improves housekeeping and streamlines development.<\/p>\n

Heap Allocation on Alternative Memory Devices: <\/strong>HotSpot VM will be able to allocate Java object heap on an alternative user-defined memory device.<\/p>\n

Root Certificates:<\/strong> JDK 10 is has been developed with the cooperation of OpenJDK. It will provide a default set of root Certification Authorities.<\/p>\n

Future Plans<\/strong><\/h3>\n

Here are some future considerations for Java:<\/p>\n