Java guides
Every published Java guide, newest first, with practical examples you can copy into your own project.
3,965 guides across 14 topics
Topics
Popular Java guides
Most readLatest Java guides
Page 6 of 109Java Wildcard Capture: Why It Happens and How to Fix It
Java wildcard capture: Learn why the compiler uses wildcard capture, how helper methods capture wildcard types, and when this pattern is necessary in Java code.
Java Generics Wildcards Explained
java generics wildcards: Learn how Java generics wildcards work, including unbounded, upper-bounded, and lower-bounded wildcards, with practical examples and common pi...
Java Sealed Class Pattern Matching Explained
Learn how sealed classes and pattern matching in Java combine to produce exhaustive, compile-time-checked switch expressions and safer type hierarchies.
Java Non Sealed Class: Breaking a Sealed Hierarchy
Understand the java non sealed class modifier: its syntax, how it differs from sealed and final, and when to open a sealed hierarchy for extension.
Java permits clause: Sealing Class Hierarchies
Learn how the Java permits clause restricts subclass hierarchies in sealed classes and interfaces, including syntax, constraints, reflection, and maintenance.
Java Record vs Immutable Class: Choosing the Right Data Carrier
Compare Java records and immutable classes for data modeling: syntax, equality, serialization, and when each approach fits better.
Java Record vs Lombok Data: Choosing the Right Approach
Compare Java records and Lombok @Data for creating data classes. Learn syntax, immutability, customization, compatibility, and when to use each approach.
Java Record Pattern: Destructuring and Matching
Learn how Java record patterns destructure records in instanceof and switch, including nested patterns and guards.
Java Records: Immutable Data Carriers
Learn how Java records reduce boilerplate for immutable data carriers, including syntax, compact constructors, restrictions, and when to use them instead of traditional classes.
Java Switch Expression Pattern Matching
Learn how Java switch expression pattern matching works: type patterns, guarded cases, sealed-type exhaustiveness, null handling, and common pitfalls.