Java 10 features: This is new
Related Videos: Java 10 Features - What Changed from JDK 9 : JDK 10 Changes Complete Overview in 15 Min || Techonica (May 2024).
With Java 10 a whole lot of new features are coming to you. We show you the eight most important changes in this practical tip.
JEP 286 - Local-Variable Type Inference
With JEP 286, developers can bypass unnecessary manifest declarations of local variables. Here the keyword "var" can be used to define local variables whose data type results directly from the assignment.
- For example, the command "var list = new ArrayList ();" defines an ArrayList of the type "String", which was previously only possible with the command "ArrayList list = new ArrayList ();".
JEP 296: Consolidate the JDK Forest into a Single Repository
So far, JDK 9 consisted of eight different repositories.
- With JDK 10 all of these (root, hotspot, corba, jaxws, jdk, jaxp, langtools and rhinoceros) are to be combined in one repository, whereby JavaFX is not one of them.
JEP 304: garbage collector interface
The Garbace Collection is an automatic garbage collection.
- With Java 10 comes a clean interface for the garbage collectors, which makes it possible to exclude garbage collectors from a Java build.
JEP 307: Parallel Full GC for G1
The G1 garbage collector was developed to avoid full collections.
- If the simultaneous collections cannot recover the memory quickly enough, an entire GC process is carried out.
- This is to be achieved by parallelizing the garbage collector.
JEP 310: Application Class Data Sharing
This JEP further extends the CDS feature (Class Data Sharing).
- Here, the start time and the amount of memory required for a program to be improved during execution.
- This enables you to use application classes in shared archives.
JEP 312: Thread-Local Handshakes
With this proposal, you can also apply a callback function to threads.
- This allows you to stop individual threads, not just all at once.
JEP 313: Remove the Native-Header Generation Tool (javah)
With the update to Java 10, the "javah" tool also disappears.
- Alternatively, you can use the "javac" function to write native header files.
JEP 314: Additional Unicode Language-Tag Extensions
The new Unicode extensions are also added to Java 10 java.util.Locale and all associated APIs.
Learn Java programming!
Are you not yet familiar with Java and would you like to learn the programming language? Then you can read through our Java tutorials, in which we explain the first steps.
In the next practical tip you will learn how you can use conditions and loops in Java.