JDK-8226915 : Release Note: JEP 354: Switch Expressions (Preview)
  • Type: Sub-task
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 13
  • Priority: P2
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2019-06-27
  • Updated: 2019-08-19
  • Resolved: 2019-06-28
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 13
Extend `switch` so it can be used as either a statement or an expression, and so that both forms can use either traditional `case ... :` labels (with fall through) or new `case ... ->` labels (with no fall through), with a further new statement for yielding a value from a `switch` expression. These changes will simplify everyday coding, and prepare the way for the use of [pattern matching](https://openjdk.java.net/jeps/8213076) in `switch`.  This is a [preview language feature](http://openjdk.java.net/jeps/12) in JDK 13.