Browse by Topic
Popular
Popular Posts
Latest
Latest Java Posts
Java Wildcard Super: Using ? super T Correctly
java wildcard super: Understand the `? super T` wildcard in Java generics, its role in the PECS rule, and how to use it for flexible, type-safe collection methods.
Java Wildcard Extends: Upper Bounded Generics
Understand how `? extends T` works in Java generics: when to use the upper bounded wildcard, its write restrictions, and how it differs from generic methods.
Java 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.