Mental model: An exception represents an abnormal condition that interrupts normal control flow. Good exception handling is not...
Continue ReadingKey distinction: Checked exceptions are enforced by the compiler through catch or throws declarations. Unchecked exceptions extend RuntimeException...
Continue ReadingPurpose: Custom exceptions give an application vocabulary for failures that matter to its domain. Instead of exposing generic...
Continue ReadingCore benefit: Try-with-resources makes cleanup part of the language syntax. Any resource implementing AutoCloseable can be declared in...
Continue ReadingCore model: A regex describes a pattern; Pattern represents the compiled pattern and Matcher applies it to input....
Continue ReadingCore purpose: Iterator provides a standard way to traverse a collection without exposing its internal representation. It also...
Continue ReadingMore than constants: An enum is a type with a fixed set of instances. Each constant can have...
Continue ReadingCore idea: A record is a concise declaration for a class whose main purpose is to model data....
Continue ReadingMetadata: Annotations attach metadata to program elements such as classes, methods, fields, and parameters. Compilers, tools, IDEs, and...
Continue ReadingCore idea: A lambda is an expression that supplies an implementation for a functional interface. It makes small...
Continue Reading