How to Use instanceof Pattern Matching in Java 16 and 21
Replace instanceof-plus-cast with pattern matching, route support tickets in plain Java 21, and see how scope, null and record patterns behave.
Replace instanceof-plus-cast with pattern matching, route support tickets in plain Java 21, and see how scope, null and record patterns behave.
Build a small CSV reader and writer in plain Java 21 that handles quoted commas, line breaks and BOMs, then use it on a currency rates file. No dependencies.
Loop over a Java Map the right way: entrySet, forEach, iterator removal, sorted output and the exceptions to expect, built on a small currency-rates feed.
Build a bounded thread pool for a support-ticket desk in Java 21: pick the size, cap the queue, name threads, count rejections, and shut down cleanly.
Convert java.util.Date, Timestamp, Calendar and epoch millis to Instant and LocalDateTime in Java 21, with zone-safe code and checks on a parcel tracker.
How to remove duplicates from a list in Java and keep order: LinkedHashSet, distinct(), removeIf and by-key dedupe, on a parcel-scan feed with 21 checks.
Build an order desk in Java 21 with the chain of responsibility pattern: validators reject, approvers escalate, and a trail shows who decided. Gradle, tested.
Learn how to use var in Java 10+ on a parcel tracker: where it helps, the diamond and ternary traps, 12 compiler errors forced on purpose, and 11 checks.
Build an immutable room booking in Java 21 with a nested builder, validation in build(), toBuilder() copies and a step builder, all compiled and run.
Build a thread-safe stock service in Java 21 with ConcurrentHashMap: merge, compute, computeIfAbsent, and the get-then-put trap that lost 300,000 updates.