Java 10, released six months after Java 9, is the first JDK release that conforms to Oracle's new six-month release cycle.
Following are the new features of Java 10.
1. Local variable type inference - Java 10 introduces the keyword 'var' which enables you to declare a local variable without specifying its type. The type for the variables is determined based on the type of object assigned to the local variable.
Example:
var myLocalVar1 = 1 //myLocalVar1 is of type int;
var myLocalVar2 = 'Ace Your Interview' //myLocalVar2 is of type String;
var myLocalVar3 = new HashMap
This is the only feature interesting from a developer point of view.
2. Unmodifiable collection enhancements - Java 10 introduces new static methods 'copyOf()' on the List, Set and Map interfaces to create unmodifiable collections. if you attempt to modify this collection then you get an UnsupportedOperationException.
3. Application class-data sharing - Class data sharing (CDS) feature has been a part of JDK since Java 8. CDS helps reduce the startup time and memory footprint between multiple Java Virtual Machines (JVM).
Java 10 introduced Application class-data sharing (ApsCDS) that extends the CDS to include selected classes from the application class path.
4. Other changes - Includes improvements to Garbage Collection, New just-in-time compiler, Consolidation of JDK to a single repository, Thread-local handshakes, Time based release versioning, and removal of javah tool from the the JDK.