-
Type:
Sub-task
-
Resolution: Delivered
-
Priority:
P2
-
Affects Version/s: 13
-
Component/s: tools
-
Verified
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.