This section summarizes the updated language features in Java SE 9 and subsequent releases.
Java Language Changes for Java SE 14
Java SE 14 introduces pattern matching for the
if the result of the
instanceof operator is
true, then the object being tested is automatically
assigned to a variable that you previously declared. See Pattern Matching for the instanceof Operator. This release also introduces records, which are a new
kind of type declaration that's ideal for "plain data carriers," classes
that contain data not meant to be altered and only the most fundamental
methods such as constructors and accessors. See Records.
Java Language Changes for Java SE 13
Java SE 13 introduces text blocks, which are multiline string
literals that don't require common escape sequences; see Programmer's Guide to
Text Blocks. It also introduces one change to
switch expressions: To specify their value, use the
yield statement instead of the
statement; see Switch Expressions
in Java Platform, Standard Edition Java Language Updates,
Java Language Changes for Java SE 12
Java SE 12 introduces
expressions, plus a new kind of
case label that prevents fall through. This
is available as a preview feature. See Switch Expressions in Java Platform, Standard Edition Java Language Updates, Release 12.
Java Language Changes for Java SE 11
Java SE 11 lets you declare formal parameters of implicitly typed lambda expressions with the
var identifier; see Local Variable Type Inference.
Java Language Changes for Java SE 10
Java SE 10 introduces support for inferring the type of local variables from the context, which makes code more readable and reduces the amount of required boilerplate code.
Java Language Changes for Java SE 9
The major change to Java Platform, Standard Edition (Java SE) 9 is the introduction of the Java Platform module system.
The Java Platform module system introduces a new kind of Java programing component, the module, which is a named, self-describing collection of code and data. Its code is organized as a set of packages containing types, i.e., Java classes and interfaces; its data includes resources and other kinds of static information. Modules can either export or encapsulate packages, and they express dependencies on other modules explicitly.
To learn more about the Java Platform module system, see Project Jigsaw on OpenJDK.