Community

Switch as an expression in Java with Lambda-like syntax

(Rafal Borowiec) As of Java 14, the switch expression has an additional Lambda-like (case … -> labels) syntax and it can be used not only as a statement, but also as an expression that evaluates to a single value.