+ 1
Switch expression in Java
The switch expression(with multiple cases) in java does not seem to work outside solo learn code playground...
1 Answer
+ 5
Check the version of Java that you're attempting to use the switch expression with. It was introduced in Java 12 and updated in Java 13 to utilize the yield statement.