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

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: P2
    • Resolution: Delivered
    • Affects Version/s: 13
    • Fix Version/s: 13
    • Component/s: tools
    • Subcomponent:
    • Verification:
      Verified

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: