Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8222184 JEP 354: Switch Expressions (Second Preview)
  3. JDK-8226915

Release Note: JEP 354: Switch Expressions (Preview)

XMLWordPrintable

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

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

              Created:
              Updated:
              Resolved: