Files
javademos/lanes/prompts/features-2-pattern-switch.txt

2 lines
226 B
Plaintext

Refactor this Java code to use Java 21 pattern matching for switch. Introduce a sealed interface if the types form a closed hierarchy. Ensure the switch is exhaustive and remove all redundant casts and intermediate variables.