Java 13 Features | Switch expression vs switch statement in java JDK 13

preview_player
Показать описание
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 in switch.

This was a preview language feature in JDK 12 and JDK 13.

#JavaBeam #Java13Features #SwitchExpressionInJava #Java #Java13NewFeatures
Рекомендации по теме
visit shbcf.ru