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

    Details

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

      Description

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

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: