Erasure and Bridge Methods in Java
See how Java bridge methods preserve generic overrides after type erasure, inspect representative javap output, and distinguish bridges from overloads.
See how Java bridge methods preserve generic overrides after type erasure, inspect representative javap output, and distinguish bridges from overloads.
Learn how Java classes define fields and methods, how constructors initialize objects, and how to create and use instances with the new keyword.
Learn how java.util.Collections sorts and searches lists, how access affects operation costs, and how synchronized wrappers and unmodifiable views behave.
Compare composition and inheritance in Java, with examples of concrete collaborators, interface-backed substitution, delegation, and safe payment retries.
Understand Java constructor initialization, this() delegation cycles, JVM allocation choices, and safe publication with final fields.
Choose Java custom exceptions for domain failures, preserve internal causes, and return stable error codes with localized safe messages at API boundaries.
Learn how Java encapsulation uses private fields, domain methods, validation, and defensive copies to preserve invariants and limit data exposure.
Explore Java enums, exhaustive switch expressions, per-constant fields, constructor rules, custom ordering, and serialization without fragile ordinals.
Learn Java's checked and unchecked exception rules, preserve causes when wrapping, log failures once at the handling boundary, and return safe API errors.
Learn how Java fields model per-object and class state, receive default values, and support encapsulation without assuming a memory layout.