• Home
  • About
    • Ahmed DAMMAK photo

      Ahmed DAMMAK

      Full Stack Developer

    • Learn More
    • Twitter
    • LinkedIn
    • Github
  • All Posts
  • All Tags
  • Projects

What's new in Java 10 ?

05 Nov 2020

Reading time ~1 minute

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 Map
  • toUnmodifiable() on Collectors
  • Optional.orElseThrow() throws NoSuchElementException 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

Links

  • Overview by baeldung
  • Performance by baeldung
  • inference by baeldung


Java10