How to Use Java Records: Build an Expense Tracker (Java 21)
Build a small expense tracker with Java 21 records: compact constructors, validation, defensive copies, with-ers and the array trap, all compiled and run.
Build a small expense tracker with Java 21 records: compact constructors, validation, defensive copies, with-ers and the array trap, all compiled and run.
Build a currency-rate feed in Java 21 where the compiler flags every switch you forgot to update. Sealed interfaces, records and sealed classes, step by step.
Replace instanceof-plus-cast with pattern matching, route support tickets in plain Java 21, and see how scope, null and record patterns behave.
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 a student-grade report in Java 21 with arrow switches, yield, guarded patterns and case null. Full code, 39 checks, and seven compile errors forced.
Learn how to use text blocks in Java 15+ on a currency-rates feed: SQL, JSON and email templates, the indentation rules, six compiler errors and 15 checks.