Java · Medium
What are unnamed patterns and variables (Java 21)? How does the underscore _ work in pattern matching?
JavaJava 17+
Answer preview
Unnamed patterns and variables (Java 22 preview, usable in Java 21 with --enable-preview) use _ to ignore bindings you don't need — improving readability of pattern matching.…