JDK 10 · JSR 383

Java 10

JDK 10 is Java SE 10, JSR 383, generally available on 20 March 2018. One language change dominates the release: local-variable type inference. The rest is runtime and platform bookkeeping, including the time-based version numbers used from here on.

How to read the status

Language

Local-Variable Type Inference

JEP 286 · Final · Language

var asks the compiler to infer the type of a local variable that has an initializer. It is not allowed for fields, parameters, or method return types.

Java 11 adds var for the parameters of implicitly typed lambdas (JEP 323). That does not extend var to fields.

OpenJDK JEP 286 (leaves JavaMastery)

Related reading: Variables and types

Curriculum file: versions4Java9To11Features.java

JVM / Runtime

Application Class-Data Sharing

JEP 310 · Final · JVM / Runtime

Application classes can be stored in a class-data sharing archive, so later runs spend less time loading them.

OpenJDK JEP 310 (leaves JavaMastery)

Experimental Java-Based JIT Compiler

JEP 317 · Experimental · JVM / Runtime

A Java-based JIT compiler is available as an experimental alternative. It is not the default HotSpot compiler.

OpenJDK JEP 317 (leaves JavaMastery)

Tools / Platform

Time-Based Release Versioning

JEP 322 · Final · Tools / Platform

Version numbers follow the six-month release train. A feature release is no longer a long list of unrelated milestones.

OpenJDK JEP 322 (leaves JavaMastery)

Examples

  • versions4Java9To11Features.javaCumulative Java 9–11 example · Requires Java 11List.of and takeWhile are Java 9. var is Java 10. The String methods are Java 11. The whole file requires Java 11. It uses Collectors.toList(), not Stream.toList().

Related reading

Historical notes

The shared file demonstrates var, and also Java 9 factories and Java 11 String methods. It requires Java 11. It is not a Java 10 program.

Sources. General availability, JSR 383, and the JEP list: OpenJDK JDK 10. OpenJDK JDK 10 (leaves JavaMastery)

All versions