Java 21 - Pattern Matching for switch
14 minute read Published: 2023-11-10Java has now extended the pattern matching feature to switch
statements. This allows an expression to be tested against a number of patterns, each for a specific action. It enables complex data-oriented queries to be expressed concisely and safely.