Articles
Java articles
Free, practical articles on Java, Spring, SQL and AI for backend developers.
-
Java equals and hashCode: what breaks in a HashMap
Why you must override hashCode when overriding equals in Java, shown with runnable HashMap and HashSet examples and the rules for writing both correctly.
-
Java Optional best practices: 7 common mistakes
Seven common Java Optional mistakes with the bad code and the fix: get(), isPresent(), orElse vs orElseGet, Optional fields and null returns.
-
Java record vs class: when to use which
A record is a final, shallowly immutable class for plain data. See what it generates, what it cannot do, and when a regular class is the better choice.
-
Java switch pattern matching: practical examples
Pattern matching for switch in Java 21 and 25: type patterns, when guards, sealed types, record patterns, null, and the compiler errors you will meet.
-
Java virtual threads: when to use them and when not
Virtual threads pay off for many tasks that block on I/O and do nothing for CPU-bound work. Pinning, pooling, ThreadLocal and Spring Boot, with measurements.
-
Java4Shell (CVE-2026-114938): check and fix your Java app
How to tell if Java4Shell affects your Java app, which JDK versions fix it, the JVM flag to use meanwhile, and three mistakes that leave you exposed.
-
Spring Boot 4 migration: what changes from Boot 3
What breaks when you migrate Spring Boot 3 to 4: modular starters, Jackson 3, removed test annotations and renamed properties. Checked on Boot 4.2.0.
-
Spring @Transactional not working: 7 causes and fixes
Why Spring @Transactional is ignored or does not roll back: self-invocation, private and final methods, checked exceptions, threads. With runnable examples.