Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8192963 JEP 325: Switch Expressions (Preview)
  3. JDK-8218616

Release Note: JEP 325: Switch Expressions (Preview)

XMLWordPrintable

    • 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).

            jlahoda Jan Lahoda
            jlahoda Jan Lahoda
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: