This post aims to resume java 10 news.
The oracle release note is available here
API updates
var - Type inference
One of the most visible enhancements in JDK 10 is type inference of local variables with initializers. The compiler infers the type.
String name = "Before Java 10" ;
var name = "After Java 10" ;
Collections
copyOf()
for List, Set and MaptoUnmodifiable()
onCollectors
Optional.orElseThrow()
throwsNoSuchElementException
by default
Container Awareness
VMs are now aware of being run in a Docker container and some options have been added :
- XX:InitialRAMPercentage
- XX:MaxRAMPercentage
- XX:MinRAMPercentage
Performance
- Parallel Full GC for G1 to improve worst-case latencies.
- Application Class-Data Sharing to optimize startup time and memory footprint when multiple JVMs share the same archive file
- Experimental Java-Based JIT Compiler
- Easier SSL With OpenJDK