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