Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    Whatever you intend to do before each break violates the LSP. Commented Feb 20, 2013 at 20:26
  • I think this is a good workaround. Commented Feb 2, 2015 at 19:06
  • man, coming back to java after using scala... I miss the kind of feature like the match-case :( Commented Jul 4, 2019 at 10:12
  • 1
    'Pattern Matching for switch' Is currently in preview for Java - see openjdk.org/jeps/433 and baeldung.com/java-switch-pattern-matching Hopefully it will be fully available in Java 21 (Sept 2023) Commented Feb 3, 2023 at 15:20