How to Implement the Decorator Pattern in Java (Java 21)
Build a currency-rates client and bolt on logging, retries, caching and validation with the decorator pattern in Java 21. Full code, order traps, 25 checks.
Build a currency-rates client and bolt on logging, retries, caching and validation with the decorator pattern in Java 21. Full code, order traps, 25 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.
Write equals() and hashCode() you can trust: a parcel tracker built with plain Java 21, four classic bugs forced on purpose, and 16 checks that prove the fix.
Build an immutable Recipe class in Java 21: final class, final fields, defensive copies and with-ers, plus the leaks a final field alone lets through.
Build an invoice calculator in Java 21 with BigDecimal: exact money, half-even rounding, tax and discounts, and a bill split that never loses a cent.
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.
See how Java strings are used in collections: why they work so well as map keys and list values, and what to keep in mind when you store them in practice.
Compare the performance of StringBuilder and string concatenation in Java, and learn when each is the right choice for building strings in your own code.
String, StringBuilder and StringBuffer in Java compared: mutability, thread safety and performance, and how to choose the right class for each situation.
Learn number formatting in Java: how to display numbers the way you want, including decimals, separators and alignment, with practical examples to follow.