How To UseSince Java 14 introduced switch expressions, using
switchIn Modern Java#post
switchisn't as straight-forward as it used to be: colons or arrows, statement or expression, labels or patterns? Here's how to best use
switchin modern Java.
nulland Upgrading Past Java 8 - Inside Java Newscast #7#video
nullis never fun, so in this newscast, I explain how to best handle it, what tools can do, and how recent and upcoming language changes help dealing with it. I'll also look at a recent blog post about how Netflix upgraded from Java 8 to 16.
Pattern Matching in Switches and Security Manager Deprecation - Inside Java Newscast #5#videoJEP 406, which is a candidate for Java 17, introduced pattern matching in
switchstatements and expressions, introduces guarded patterns, and improves null handling. Then we need to talk about JEP 411's deprecation of the security manager.
Definitive Guide To Switch Expressions In Java 13#postJava 13 finalized switch expressions. Together with a new lambda-style arrow syntax, this makes switch more expressive and less error-prone.