JDK-8218616 : Release Note: JEP 325: Switch Expressions (Preview)
  • Type: Sub-task
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 12
  • Priority: P3
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2019-02-07
  • Updated: 2019-04-05
  • Resolved: 2019-02-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 12
12Resolved
Description
The Java language enhances the `switch` statement so that it can be used as either a statement or an expression. Using `switch` as an expression often results in code that is more concise and readable. Both the statement and expression form can use either traditional `case ... :` labels (with fall through) or simplified `case ... ->` labels (no fall through). Also, both forms can switch on multiple constants in one case. These enhancements to `switch` are a [preview language feature](http://openjdk.java.net/jeps/12).