Java Glossary
Key terms from the Java course, linked to the lesson that introduces each one.
3,257 terms.
#
- `add(e)`
- throws an `IllegalStateException` if the queue is at capacity
- Lesson 1172 — Queue Capacity Restrictions and Bounded QueuesLesson 1199 — Queue Methods: add, remove, element, offer, poll
- `AutoCloseable`
- is the more general parent interface for *any* resource that needs cleanup.
- Lesson 824 — AutoCloseable vs CloseableLesson 1946 — AutoCloseable and Closeable Interfaces
- `ceiling(E e)`
- – Returns the smallest element ≥ e (the "ceiling" above you)
- Lesson 975 — NavigableSet and NavigableMap: Enhanced NavigationLesson 1094 — NavigableSet Interface: Sorted Set with Navigation MethodsLesson 1096 — Higher and Ceiling: Finding Elements Above a Given Value
- `class`
- – the keyword that tells Java you're declaring a class
- Lesson 305 — Declaring a Class: Syntax and Naming ConventionsLesson 2433 — The @Retention Meta- Annotation
- `Class` object
- that acts as a gateway into Java's *reflection API*.
- Lesson 573 — Class Objects and Reflection Entry PointLesson 2320 — What is the Class Object?
- `ClassNotFoundException`
- is a **checked exception** that occurs when your code *explicitly* tries to load a class by name at runtime (using reflection or similar mechanisms), but Java can't find it.
- Lesson 807 — ClassNotFoundException and NoClassDefFoundErrorLesson 2141 — The readObject Method Signature
- `close()`
- – Closes the stream and releases resources
- Lesson 1960 — The Writer Hierarchy: Character-Based OutputLesson 1966 — Closing Readers and Writers: Resource Management
- `Closeable`
- Requires `close()` for resource cleanup (e.
- Lesson 504 — Practical Example: Multiple Capability InterfacesLesson 824 — AutoCloseable vs CloseableLesson 1946 — AutoCloseable and Closeable Interfaces
- `DirectoryStream`
- A **lazy iterator** that fetches directory entries one-by-one as you loop through them.
- Lesson 2080 — DirectoryStream vs Files.list: When to Use WhichLesson 2083 — Performance Considerations for Large Directories
- `element()`
- Returns the head element of the queue **without removing it**.
- Lesson 1169 — Queue Inspection Methods: element and peekLesson 1199 — Queue Methods: add, remove, element, offer, poll
- `entrySet()`
- Iterates through key-value pairs in that *same* order
- Lesson 1150 — Iteration Order GuaranteesLesson 1391 — Stream from Map: entrySet(), keySet(), values()
- `Exception`
- For recoverable conditions your program should handle
- Lesson 774 — The Throwable Class: Root of All Exceptions and ErrorsLesson 777 — Exception as the Base for Application Problems
- `exports`
- the keyword that declares visibility
- Lesson 2481 — Basic exports Syntax in module-info.javaLesson 2490 — Syntax of opens in module- info.javaLesson 2533 — Dealing with Reflection-Heavy Frameworks
- `false`
- Lesson 350 — Default Values for Uninitialized FieldsLesson 1148 — The removeEldestEntry Hook MethodLesson 1964 — The ready() Method: Non-Blocking ChecksLesson 1971 — Append Mode: Adding to Existing Files with FileWriterLesson 2100 — Resetting the WatchKey for Continued MonitoringLesson 2743 — isDone(): Checking Task Completion Non-Blockingly
- `Files.list()`
- provides a more modern alternative by returning a `Stream<Path>` of all direct children in a directory.
- Lesson 2078 — Files.list: Stream-Based Directory ListingLesson 2080 — DirectoryStream vs Files.list: When to Use WhichLesson 2083 — Performance Considerations for Large Directories
- `filter`
- evaluates the predicate against *every* element in the stream, keeping those that match and discarding those that don't.
- Lesson 1473 — takeWhile vs filter: Key DifferencesLesson 1809 — Real-World Example: Safe Property Access
- `final`
- – cannot be reassigned after initialization
- Lesson 491 — Interface Constants: public static final by DefaultLesson 580 — Enum Values Are Public Static Final ConstantsLesson 727 — Immutability and final: Defensive Access ControlLesson 2124 — Declaring an Explicit serialVersionUID
- `findAny()`
- returns any matching element.
- Lesson 1412 — Terminal Short-Circuiting: findFirst and findAnyLesson 1541 — Understanding findFirst and findAny Terminal Operations
- `findFirst()`
- returns the first element in the stream that matches your filtering criteria (or just the first element if no filter is applied).
- Lesson 1412 — Terminal Short-Circuiting: findFirst and findAnyLesson 1541 — Understanding findFirst and findAny Terminal Operations
- `flatMap`
- when your function returns an `Optional`
- Lesson 1441 — flatMap with Optional: Avoiding Nested OptionalsLesson 1806 — When to Use flatMap vs mapLesson 1809 — Real-World Example: Safe Property Access
- `floor(E e)`
- – Returns the largest element ≤ e (the "floor" below you)
- Lesson 975 — NavigableSet and NavigableMap: Enhanced NavigationLesson 1094 — NavigableSet Interface: Sorted Set with Navigation MethodsLesson 1095 — Lower and Floor: Finding Elements Below a Given Value
- `flush()`
- – Forces buffered characters to be written immediately
- Lesson 1960 — The Writer Hierarchy: Character-Based OutputLesson 1966 — Closing Readers and Writers: Resource Management
- `ForkJoinPool.commonPool()`
- .
- Lesson 2789 — Default Thread Pool: ForkJoinPool.commonPool()Lesson 2863 — Default Executor: ForkJoinPool.commonPool()
- `getSupportedAnnotationTypes()`
- Returns which annotations your processor handles (e.
- Lesson 2454 — The Processor InterfaceLesson 2455 — AbstractProcessor: A Convenient Base Class
- `getSupportedSourceVersion()`
- Declares which Java version your processor supports
- Lesson 2454 — The Processor InterfaceLesson 2455 — AbstractProcessor: A Convenient Base Class
- `hashCode()`
- Provides an integer representation for efficient lookup
- Lesson 970 — Set Interface: Unordered Collections Without DuplicatesLesson 1449 — Using distinct with Custom Objects
- `higher(E e)`
- – Returns the smallest element strictly > e (step up)
- Lesson 975 — NavigableSet and NavigableMap: Enhanced NavigationLesson 1094 — NavigableSet Interface: Sorted Set with Navigation MethodsLesson 1096 — Higher and Ceiling: Finding Elements Above a Given Value
- `ifPresent(consumer)`
- Only act if value exists
- Lesson 1758 — Optional Forces Deliberate HandlingLesson 1817 — When or Completes the Chain: Terminal Operations
- `IOException`
- is the parent class for most file operation errors.
- Lesson 2053 — Exception Handling for File Read/Write OperationsLesson 2141 — The readObject Method Signature
- `keySet()`
- Iterates through keys in your chosen order (insertion or access)
- Lesson 1150 — Iteration Order GuaranteesLesson 1391 — Stream from Map: entrySet(), keySet(), values()
- `List<?>`
- A list of *unknown but specific* type.
- Lesson 928 — The Unbounded Wildcard: ? BasicsLesson 949 — Unbounded Wildcards: The ? Type
- `List<Object>`
- A list specifically of `Object` references.
- Lesson 928 — The Unbounded Wildcard: ? BasicsLesson 949 — Unbounded Wildcards: The ? Type
- `lower(E e)`
- – Returns the largest element strictly < e (step down)
- Lesson 975 — NavigableSet and NavigableMap: Enhanced NavigationLesson 1094 — NavigableSet Interface: Sorted Set with Navigation MethodsLesson 1095 — Lower and Floor: Finding Elements Below a Given Value
- `map`
- when your transformation function returns a plain value
- Lesson 1441 — flatMap with Optional: Avoiding Nested OptionalsLesson 1806 — When to Use flatMap vs mapLesson 1809 — Real-World Example: Safe Property Access
- `null`
- .
- Lesson 280 — Default Values: Primitives vs ReferencesLesson 350 — Default Values for Uninitialized FieldsLesson 2344 — Invoking Static Methods Reflectively
- `offer()`
- adds elements to the **tail** (end) of the list
- Lesson 1179 — FIFO Semantics with LinkedListLesson 1186 — Adding Elements: offer vs add
- `offer(E e)`
- Adds an element to the tail (back) of the queue.
- Lesson 971 — Queue Interface: FIFO ProcessingLesson 1186 — Adding Elements: offer vs add
- `offer(e)`
- returns `false` if the queue is full, without throwing an exception
- Lesson 1172 — Queue Capacity Restrictions and Bounded QueuesLesson 1199 — Queue Methods: add, remove, element, offer, poll
- `opens`
- Allows deep reflection on *all* types (public and non-public), but doesn't grant normal access
- Lesson 2490 — Syntax of opens in module-info.javaLesson 2533 — Dealing with Reflection-Heavy Frameworks
- `or()`
- – At least one condition must be true
- Lesson 1539 — Combining Match Operations with Complex PredicatesLesson 1810 — The or Method: Providing Alternative OptionalsLesson 1817 — When or Completes the Chain: Terminal Operations
- `orElse(defaultValue)`
- Provide a fallback value
- Lesson 1758 — Optional Forces Deliberate HandlingLesson 1817 — When or Completes the Chain: Terminal Operations
- `orElseGet(supplier)`
- Compute a fallback lazily
- Lesson 1758 — Optional Forces Deliberate HandlingLesson 1784 — Choosing Between orElse and orElseGetLesson 1817 — When or Completes the Chain: Terminal Operations
- `peek()`
- Returns (but doesn't remove) the element at the head.
- Lesson 971 — Queue Interface: FIFO ProcessingLesson 1169 — Queue Inspection Methods: element and peekLesson 1179 — FIFO Semantics with LinkedListLesson 1187 — Retrieving the Head: peek and pollLesson 1198 — Stack Methods: push, pop, and peek
- `poll()`
- Removes and returns the element at the head (front) of the queue.
- Lesson 971 — Queue Interface: FIFO ProcessingLesson 1168 — Queue Core Methods: add, offer, remove, pollLesson 1179 — FIFO Semantics with LinkedListLesson 1187 — Retrieving the Head: peek and pollLesson 1199 — Queue Methods: add, remove, element, offer, poll
- `pollFirst()`
- removes and returns the *lowest* element in the set.
- Lesson 1097 — PollFirst and PollLast: Retrieving and Removing Extreme ElementsLesson 1196 — Offer and Poll Variants: offerFirst, offerLast, pollFirst, pollLastLesson 1199 — Queue Methods: add, remove, element, offer, pollLesson 1205 — Removing Elements: removeFirst, removeLast, pollFirst, pollLast
- `pollLast()`
- removes and returns the *highest* element in the set.
- Lesson 1097 — PollFirst and PollLast: Retrieving and Removing Extreme ElementsLesson 1196 — Offer and Poll Variants: offerFirst, offerLast, pollFirst, pollLastLesson 1205 — Removing Elements: removeFirst, removeLast, pollFirst, pollLast
- `pop()`
- → Maps to `removeFirst()` — removes and returns the front element
- Lesson 1198 — Stack Methods: push, pop, and peekLesson 1212 — push and pop: Stack Operations on Deque
- `postVisitDirectory`
- it's called *after* all the directory's contents have been visited.
- Lesson 2063 — Recursive Directory Deletion with walkFileTreeLesson 2088 — SimpleFileVisitor: Default ImplementationsLesson 2089 — Files.walkFileTree for Complex Traversals
- `preVisitDirectory`
- Returns `CONTINUE` (proceed into the directory)
- Lesson 2088 — SimpleFileVisitor: Default ImplementationsLesson 2089 — Files.walkFileTree for Complex Traversals
- `private`
- Only accessible within the same class (use this almost always)
- Lesson 332 — Access Modifiers on FieldsLesson 335 — Comparing Access Levels: A Decision MatrixLesson 398 — Access Modifiers and Inherited MembersLesson 698 — Member-Level Access Modifiers: The Four OptionsLesson 727 — Immutability and final: Defensive Access ControlLesson 2124 — Declaring an Explicit serialVersionUIDLesson 2140 — The writeObject Method Signature
- `protected`
- Accessible to subclasses and same package (occasionally useful)
- Lesson 332 — Access Modifiers on FieldsLesson 335 — Comparing Access Levels: A Decision MatrixLesson 398 — Access Modifiers and Inherited MembersLesson 698 — Member-Level Access Modifiers: The Four Options
- `public`
- – The JVM needs to access this method from outside your code
- Lesson 10 — The main Method: Entry Point of ExecutionLesson 305 — Declaring a Class: Syntax and Naming ConventionsLesson 331 — Access Modifiers on ClassesLesson 332 — Access Modifiers on FieldsLesson 335 — Comparing Access Levels: A Decision MatrixLesson 398 — Access Modifiers and Inherited MembersLesson 491 — Interface Constants: public static final by DefaultLesson 535 — Overriding toString: Basic Syntax (+2 more)
- `remove()`
- Removes and returns the head element.
- Lesson 1168 — Queue Core Methods: add, offer, remove, pollLesson 1199 — Queue Methods: add, remove, element, offer, poll
- `removeFirst()`
- Move `head` to `head.
- Lesson 1021 — Head and Tail ReferencesLesson 1199 — Queue Methods: add, remove, element, offer, pollLesson 1205 — Removing Elements: removeFirst, removeLast, pollFirst, pollLast
- `removeLast()`
- A bit trickier in doubly-linked lists, but still efficient by starting from `tail`.
- Lesson 1021 — Head and Tail ReferencesLesson 1205 — Removing Elements: removeFirst, removeLast, pollFirst, pollLast
- `static`
- – The JVM must call this method without creating an object first
- Lesson 10 — The main Method: Entry Point of ExecutionLesson 491 — Interface Constants: public static final by DefaultLesson 580 — Enum Values Are Public Static Final ConstantsLesson 2124 — Declaring an Explicit serialVersionUID
- `String`
- – the class for text
- Lesson 429 — final Classes in the JDK: String and WrappersLesson 535 — Overriding toString: Basic Syntax
- `supplyAsync`
- .
- Lesson 2787 — Introduction to supplyAsync: Creating Asynchronous TasksLesson 2792 — When to Use supplyAsync vs runAsync
- `T`
- The type of elements flowing *into* both downstream collectors.
- Lesson 1608 — The teeing Method Signature and Type ParametersLesson 1617 — Accumulator: Adding Elements to the Container
- `thenApply`
- Runs on whichever thread completes the previous stage.
- Lesson 2801 — thenApply vs thenApplyAsyncLesson 2818 — thenCompose vs thenApply: When to Use Which
- `thenCompose`
- Use when your function takes a value and returns a **`CompletableFuture`** (like calling another async operation)
- Lesson 2818 — thenCompose vs thenApply: When to Use WhichLesson 2829 — thenCombine vs thenCompose: Key Differences
- `toString()`
- exact method name, no parameters
- Lesson 535 — Overriding toString: Basic SyntaxLesson 732 — Accessing Exception Information in catch Blocks
- `trim()`
- Returns a new String with whitespace removed from ends
- Lesson 2174 — String Methods Return New InstancesLesson 2212 — trim() vs strip(): Whitespace Removal Differences
- `true`
- Remove the oldest entry
- Lesson 1148 — The removeEldestEntry Hook MethodLesson 1964 — The ready() Method: Non-Blocking ChecksLesson 1971 — Append Mode: Adding to Existing Files with FileWriterLesson 2100 — Resetting the WatchKey for Continued MonitoringLesson 2743 — isDone(): Checking Task Completion Non-Blockingly
- `values()`
- Iterates through values in the *same* order as their corresponding keys
- Lesson 1150 — Iteration Order GuaranteesLesson 1391 — Stream from Map: entrySet(), keySet(), values()
- `visitFile`
- Returns `CONTINUE` (move to next file)
- Lesson 2088 — SimpleFileVisitor: Default ImplementationsLesson 2089 — Files.walkFileTree for Complex Traversals
- `visitFileFailed`
- Rethrows the IOException (fail fast)
- Lesson 2088 — SimpleFileVisitor: Default ImplementationsLesson 2089 — Files.walkFileTree for Complex Traversals
- `void`
- – This method doesn't return any value back to the JVM
- Lesson 10 — The main Method: Entry Point of ExecutionLesson 2140 — The writeObject Method Signature
- `write(char[] cbuf)`
- – Writes an entire character array
- Lesson 1960 — The Writer Hierarchy: Character-Based OutputLesson 1963 — Writer's Core Methods: write(), write(char[]), and flush()
- `write(int c)`
- – Writes a single character (the low 16 bits of the int)
- Lesson 1960 — The Writer Hierarchy: Character-Based OutputLesson 1963 — Writer's Core Methods: write(), write(char[]), and flush()
- 13th element
- (because size would exceed 12).
- Lesson 1060 — Threshold: When Rehashing TriggersLesson 1125 — When Rehashing Occurs: The Threshold Calculation
A
- absence
- of a modifier means package-private.
- Lesson 328 — Package-Private (Default) AccessLesson 1772 — The isEmpty() Method (Java 11+)
- Absolute
- `"/home/user/data.
- Lesson 1914 — Creating FileInputStream: Constructor Options and File Paths
- Absolute paths
- specify the complete location of a file or directory from the root of the filesystem.
- Lesson 2027 — Absolute vs Relative Paths
- abstract class
- is a class that is intentionally incomplete.
- Lesson 477 — What Are Abstract Classes?Lesson 478 — The abstract Keyword for ClassesLesson 495 — Interfaces vs Abstract Classes: Initial ComparisonLesson 2376 — Exception Handling in Reflective Instantiation
- abstract classes
- and **interfaces**, let's clarify a key distinction that sets them apart at the structural level.
- Lesson 495 — Interfaces vs Abstract Classes: Initial ComparisonLesson 513 — Default Methods and Abstract ClassesLesson 528 — Evolution and Backward Compatibility Concerns
- Abstract methods
- from all interfaces create mandatory obligations
- Lesson 502 — Combining Abstract and Default Methods from Multiple InterfacesLesson 529 — The Template Method Pattern with Abstract Classes
- Abstraction
- Your method can throw domain-specific exceptions without exposing implementation details
- Lesson 769 — Wrapping Exceptions: throw new Exception(cause)
- Abstraction cost
- Collections vary in structure (linked nodes, hash tables, trees)
- Lesson 1392 — Collection.stream() vs Arrays.stream() Performance Considerations
- Access
- | Through object instance | Through interface name only |
- Lesson 518 — Static Methods vs Default Methods: Key Differences
- Access control
- Abstract class methods can be `protected` or package-private.
- Lesson 513 — Default Methods and Abstract ClassesLesson 658 — What Are Packages and Why They Matter
- Access Control Violations
- It bypasses compile-time accessibility checks in ways that are inconsistent with how `Constructor.
- Lesson 2374 — Using Class.newInstance() and Its Deprecation
- access modifier
- (often omitted for now, defaults to package-private)
- Lesson 306 — Fields: Instance Variables in a ClassLesson 398 — Access Modifiers and Inherited MembersLesson 2119 — writeObject() and readObject() Method Signatures
- Access nested properties
- `order -> order.
- Lesson 1339 — Comparator.comparing() with Lambda Expressions
- Access order
- Entries move to the end when accessed (useful for LRU caches)
- Lesson 1142 — LinkedHashMap Overview: Ordering in Maps
- Access to annotated elements
- `getElementsAnnotatedWith(MyAnnotation.
- Lesson 2457 — The RoundEnvironment and Processing Rounds
- Access to both ends
- adding or removing from either front or back
- Lesson 984 — Queue vs Deque: Choosing the Right End-Access Pattern
- Access to class methods
- – you can call `Number` methods like `doubleValue()` inside your generic class
- Lesson 912 — Bounded Type Parameters with Classes
- AccessDeniedException
- occurs when the directory exists, but your process lacks the necessary read permissions.
- Lesson 2082 — Error Handling: NoSuchFileException and AccessDeniedException
- Accessing array elements
- Lesson 285 — NullPointerException: Causes and Prevention
- Accessing object fields
- Lesson 285 — NullPointerException: Causes and Prevention
- Accessor methods
- (getters and setters) solve this by providing controlled access to private fields:
- Lesson 338 — The Purpose of Getters and Setters
- Accumulator
- Adds each element to the container (like placing items in the box)
- Lesson 1515 — The Three-Argument collect OverloadLesson 1619 — Finisher: Transforming the Accumulator to Final Result
- Accumulator function
- A binary operator that combines two values into one
- Lesson 1506 — reduce with Identity: T reduce(T identity, BinaryOperator<T>)
- actual object's class
- to find which version of the method to execute.
- Lesson 461 — Method Resolution Process OverviewLesson 467 — Method Resolution with Interfaces
- Actual parameters
- (also called "arguments") are the real values or variables you pass into the method when you call it.
- Lesson 197 — Method Parameters: Formal vs Actual Parameters
- actual runtime type
- of that object—not the declared type of the variable, but what the object *really* is at that moment.
- Lesson 571 — The getClass Method: Runtime Type InformationLesson 2321 — Three Ways to Obtain a Class ObjectLesson 2323 — Using getClass() on Object Instances
- Adaptive
- Runs faster on partially sorted data
- Lesson 1221 — Sorting Stability and Implementation Details
- add
- (at end): O(1) amortized
- Lesson 988 — Performance Characteristics Summary: Big-O ComplexitiesLesson 1383 — Builder Pattern for Stream CreationLesson 1918 — FileOutputStream Constructors: Overwrite vs Append Mode
- Add `implements Comparable<YourClass>`
- to your class declaration
- Lesson 1311 — Implementing Comparable in a Custom Class
- Add the requires directive
- to your `module-info.
- Lesson 2479 — Diagnosing Missing requires Declarations
- Add validation
- Ensure data integrity before accepting changes
- Lesson 723 — Prefer private Fields with Controlled Public Methods
- Adding context
- Log additional state information before propagation
- Lesson 745 — Re-throwing Exceptions After Partial Handling
- Adding elements
- Lesson 600 — EnumSet Operations: Add, Remove, and Bulk ModificationsLesson 972 — Deque Interface: Double-Ended Queue OperationsLesson 1167 — Queue Interface Overview and FIFO Semantics
- Adding fields
- New fields get default values (`null` for objects, `0` for numbers, `false` for booleans) when deserializing old data
- Lesson 2164 — Versioning Problems and Class Evolution
- Adding new fields
- New fields get default values (null, 0, false) when reading old data
- Lesson 2126 — Compatible vs Incompatible Class Changes
- Additional traversals
- Each subsequent `.
- Lesson 1613 — Performance Benefits of teeing Over Multiple Passes
- Address Thread Safety
- Lesson 1903 — Migration Checklist and Common Pitfalls
- Adds another abstract method
- → No longer functional (2+ abstract methods)
- Lesson 2420 — Inheritance and @FunctionalInterface
- Adoptium
- or **Amazon Corretto** are excellent choices.
- Lesson 3 — Choosing a JDK Distribution: Oracle, OpenJDK, and Others
- Adoptium (formerly AdoptOpenJDK)
- – A popular, free distribution of OpenJDK backed by the Eclipse Foundation.
- Lesson 3 — Choosing a JDK Distribution: Oracle, OpenJDK, and Others
- Advances
- the iterator's position forward by one element
- Lesson 1276 — next(): Retrieving the Next Element
- After (Java 7+)
- Lesson 2182 — Intern Pool Location: PermGen vs Metaspace
- After (Lambda)
- Lesson 651 — Basic Lambda Conversion: Removing BoilerplateLesson 657 — Practical Migration: Collections and Event Handlers
- After (pattern matching)
- Lesson 459 — Migrating Legacy Code to Pattern Matching
- After `supplyAsync`
- – catch initial failures early
- Lesson 2852 — Combining handle with Other CompletableFuture Methods
- After `thenCombine`
- – handle errors from either of the combined futures
- Lesson 2852 — Combining handle with Other CompletableFuture Methods
- After a volatile read
- All subsequent reads must fetch fresh values from main memory.
- Lesson 2689 — volatile in the Java Memory Model: Formal Guarantees
- After sleep completes
- Thread transitions back to `RUNNABLE` state (now eligible for CPU time again)
- Lesson 2592 — What Happens During sleep: Thread State Changes
- Aggregations
- counting, summing, averaging, finding min/max
- Lesson 1522 — Why collect Is the Gateway to Advanced Collectors
- Algorithm implementations
- like Dijkstra's shortest path or Huffman coding
- Lesson 1183 — What Is a PriorityQueue?
- all
- `Counter` objects
- Lesson 359 — Declaring static FieldsLesson 483 — Abstract Subclasses: Deferring ImplementationLesson 622 — What Are Inner Classes?Lesson 630 — Inner Classes and EncapsulationLesson 843 — Multiple Resource SuppressionLesson 1270 — Collections.fill: Setting All Elements to a ValueLesson 1408 — Infinite Streams and LazinessLesson 1413 — Terminal Short-Circuiting: anyMatch, allMatch, noneMatch (+11 more)
- All 50 have completed
- (success or failure) before proceeding
- Lesson 2853 — Understanding the Need for Multiple Futures Coordination
- All access levels
- public, protected, private, and package-private methods
- Lesson 2334 — Getting Declared Methods: Class-Specific Methods Only
- All elements processed
- , even if you only need one
- Lesson 1410 — Contrasting Eager Collection Operations
- all instances
- of "Java" were replaced.
- Lesson 2202 — The replace Method: Replacing SubstringsLesson 2665 — Class-Level Locks with synchronized(ClassName.class)
- All modules
- gain deep reflective access, including third-party libraries you might add later.
- Lesson 2492 — Unconditional opens: Opening Packages to All Modules
- All tasks complete
- after a shutdown request
- Lesson 2718 — awaitTermination: Blocking Until Shutdown CompletesLesson 2773 — awaitTermination(): Waiting for Shutdown Completion
- All-or-nothing updates
- where every field in the method must change together
- Lesson 2660 — When to Use Synchronized Methods
- Allocate
- a new array with the expanded capacity
- Lesson 1008 — System.arraycopy: The Reallocation Mechanism
- Allocates OS resources
- It requests a new native thread from the operating system, which involves setting up a call stack, program counter, and other low-level resources needed for independent execution.
- Lesson 2573 — The start() Method: Launching a Thread
- Allow coordinated shutdown
- of thread pools and executors
- Lesson 2598 — Restoring Interrupt Status in catch Blocks
- Allowed
- Same type or narrower (subclass)
- Lesson 419 — Return Type Compatibility in OverridingLesson 708 — Accessing Protected Members in Subclasses Across PackagesLesson 719 — Protected Reference Type Restrictions
- Allowed characters
- Letters, digits, underscores, hyphens
- Lesson 2289 — Username and Identifier Patterns
- Already done
- After `invokeAll` returns, calling `get()` on any `Future` won't block (though it may throw `ExecutionException`)
- Lesson 2758 — invokeAll: Executing Multiple Callables
- Alternative algorithms
- Racing different algorithms solving the same problem (e.
- Lesson 2767 — Use Cases: invokeAll vs invokeAny
- Alternative approaches
- for huge datasets might include pre-filtering, database-level deduplication, or external sorting algorithms—but those techniques aren't yet in your toolkit.
- Lesson 1448 — Performance Implications of distinct on Large Streams
- always
- an `int`—never a decimal.
- Lesson 37 — Common Pitfalls: Integer Division and TruncationLesson 371 — Multiple Static Blocks and Execution OrderLesson 391 — Testing Utility ClassesLesson 692 — Classpath Order and Class Loading PrecedenceLesson 735 — Control Flow with try-catch-finallyLesson 1073 — Iterating TreeSet: Always Sorted OrderLesson 1544 — Encounter Order and Its Impact on find OperationsLesson 1578 — Understanding partitioningBy and Binary Classification (+4 more)
- always executes
- (whether an exception occurs or not), it's the perfect place to ensure cleanup happens.
- Lesson 734 — Common finally Use Cases: Resource CleanupLesson 2846 — Processing Successful Results with handle
- Always returns Double
- Regardless of which variant you use, the result is always `Double`.
- Lesson 1590 — The averagingInt, averagingLong, and averagingDouble Collectors
- Always safe
- You can read while others write, with no corruption or crashes
- Lesson 1307 — ConcurrentHashMap and Weakly Consistent Iterators
- Always use braces
- to make your intent crystal clear:
- Lesson 143 — Dangling else Problem: Ambiguity in Nested Conditionals
- always use uppercase `L`
- .
- Lesson 29 — The L Suffix for long LiteralsLesson 57 — Long Literals and the L Suffix
- Always validate before accessing
- Lesson 795 — ArrayIndexOutOfBoundsException and Bounds Checking
- Always validate in `readObject`
- Every custom `readObject` method should validate all fields after reading them.
- Lesson 2166 — Best Practices for Safe Serialization
- Amazon Corretto
- – Amazon's free, production-ready distribution of OpenJDK with long-term support.
- Lesson 3 — Choosing a JDK Distribution: Oracle, OpenJDK, and Others
- ambiguity
- like when a parameter has the same name as a field:
- Lesson 318 — this in Instance MethodsLesson 1163 — Null Keys and Values: Not Allowed in ConcurrentHashMap
- American Express
- Lesson 2288 — Credit Card Number Patterns
- Amortized analysis
- averages the cost of operations over a sequence, rather than focusing on the worst single case.
- Lesson 1016 — Amortized Analysis: Why O(1) Despite Occasional O(n)
- Analogy
- It's like writing a note that says "I need 1 liter" vs "I need l liter"—the second is confusing because lowercase L and the number 1 look the same!
- Lesson 29 — The L Suffix for long LiteralsLesson 31 — The byte Type: Single-Byte IntegersLesson 84 — Compound Assignment Operators and Implicit CastingLesson 163 — Infinite Loops: Intentional and AccidentalLesson 172 — Enhanced for Loop Limitations: No Index or ModificationLesson 264 — Arrays.toString: Converting Arrays to StringsLesson 285 — NullPointerException: Causes and PreventionLesson 389 — When NOT to Use Utility Classes (+64 more)
- Animation or timed events
- Games, UI animations, or scheduled tasks often need precise timing between frames or updates.
- Lesson 2590 — The Purpose of Thread.sleep
- Annotation Processing Workflows
- Both frameworks read annotations at runtime using the techniques you've learned: `isAnnotationPresent()`, `getAnnotation()`, and extracting element values.
- Lesson 2388 — Common Use Cases: Frameworks and Libraries
- anonymous class
- has no name and is declared and instantiated in one expression.
- Lesson 638 — Local Classes vs Anonymous ClassesLesson 639 — Practical Use Cases for Local ClassesLesson 640 — What Are Anonymous Classes?Lesson 641 — Anonymous Class SyntaxLesson 652 — Lambda Conversions with Parameters and Return ValuesLesson 655 — this and super Semantics: Key DifferencesLesson 1329 — Implementing Comparator with Anonymous Classes
- anonymous classes
- let you define a class inside a method, but they differ in naming, reusability, and flexibility.
- Lesson 638 — Local Classes vs Anonymous ClassesLesson 649 — When to Prefer Lambdas Over Anonymous Classes
- any
- parameterized type
- Lesson 928 — The Unbounded Wildcard: ? BasicsLesson 1242 — Collections.unmodifiableCollection for Generic TypesLesson 1413 — Terminal Short-Circuiting: anyMatch, allMatch, noneMatchLesson 1544 — Encounter Order and Its Impact on find OperationsLesson 2335 — Getting a Specific Method by Name and ParametersLesson 2371 — Getting Constructor Objects via ReflectionLesson 2655 — Only One Thread Executes at a Time
- Any modification
- to captured variables after the lambda is defined
- Lesson 1721 — Attempting to Modify Captured Variables
- Any one completes first
- to return the fastest result
- Lesson 2853 — Understanding the Need for Multiple Futures Coordination
- anywhere
- inside that class where you'd normally specify a type.
- Lesson 861 — Type Parameters in Fields, Methods, and ConstructorsLesson 1177 — Queue vs List Methods on LinkedListLesson 2249 — The lookingAt() Method: Prefix MatchingLesson 2442 — Understanding @Target and ElementType
- AOP features
- (proxies, interceptors)
- Lesson 2507 — Service Loading vs Traditional Dependency Injection
- API boundaries
- Passing data between old and new code sections
- Lesson 2032 — Converting Between Path and File
- API compatibility
- and **whether you need mutability**.
- Lesson 1502 — Comparing toArray() with collect(toList())
- API Surface Clarity
- Overusing `opens` blurs the line between your public API (what you `export`) and your implementation details.
- Lesson 2497 — Security and Design Trade-offs with opens
- Append
- (`true`): Log files, incremental data collection, audit trails
- Lesson 1918 — FileOutputStream Constructors: Overwrite vs Append ModeLesson 2051 — OpenOption: Controlling Write Behavior
- Applications where simplicity matters
- more than micro-optimizing I/O
- Lesson 1935 — Default Buffer Size: 8KB Explained
- Apply different rejection policies
- Define what happens when capacity is reached
- Lesson 2866 — Why Custom Executors Matter: Isolation and Resource Control
- Appropriate for
- Lesson 2035 — Reading All Bytes: Files.readAllBytes
- Argument boxing/unboxing
- overhead (primitives must be wrapped for invoke)
- Lesson 2398 — Method Invocation Overhead: invoke vs Direct Calls
- Argument count mismatches
- Forgetting an argument or passing extras throws `MissingFormatArgumentException` or is silently ignored.
- Lesson 2233 — Common Formatting Patterns and Pitfalls
- array
- behind the scenes.
- Lesson 217 — Varargs as ArraysLesson 1011 — ArrayList's Internal Array and Capacity ConceptLesson 1102 — HashMap Structure: Arrays of BucketsLesson 1502 — Comparing toArray() with collect(toList())
- Array covariance
- Java arrays are covariant, meaning `String[]` is a subtype of `Object[]`.
- Lesson 960 — Cannot Create Arrays of Parameterized Types
- Array parameters
- require the caller to explicitly create an array: `myMethod(new int[]{1, 2, 3})`
- Lesson 222 — Varargs vs Array Parameters
- Array wrapping
- for arguments creates temporary objects
- Lesson 2395 — Performance Overhead of Reflection
- ArrayDeque
- beats `LinkedList` for queue/deque operations due to better cache locality
- Lesson 1046 — Use Case: When to Choose LinkedList (Rarely)Lesson 1181 — Performance Characteristics of LinkedList QueueLesson 1209 — ArrayDeque vs LinkedList: When to Use Which
- ArrayList
- stores elements in a contiguous array—fast for random access but slower for frequent insertions/deletions.
- Lesson 907 — LinkedList<E> and Other Generic List ImplementationsLesson 1028 — Memory Overhead of NodesLesson 1031 — Vector vs ArrayList: Key DifferencesLesson 1037 — Time Complexity: ArrayList vs LinkedList for AccessLesson 1038 — Time Complexity: Insertion at BeginningLesson 1040 — Time Complexity: Insertion in MiddleLesson 1042 — Memory Overhead: ArrayList Capacity vs LinkedList NodesLesson 1518 — Collectors.toCollection() for Specific Collection Types
- ArrayList's Iterator
- Because `ArrayList` stores elements in a contiguous array, its iterator simply increments an index to move from element to element.
- Lesson 1044 — Iteration Performance: Sequential Access Patterns
- arrays
- of objects.
- Lesson 1358 — Sorting Arrays with Arrays.sort()Lesson 2322 — Using .class Literal SyntaxLesson 2384 — Extracting Annotation Element ValuesLesson 2425 — Element Types: Primitives, Strings, and Classes
- Arrays.sort(T[], Comparator)
- Lesson 1334 — Passing Comparators to Sort Methods
- As a Queue (FIFO)
- Add at the back, remove from the front
- Lesson 1194 — Deque as Queue and Stack: Dual Behavior
- As a Stack (LIFO)
- Add and remove from the same end
- Lesson 1194 — Deque as Queue and Stack: Dual Behavior
- ASCII
- Maps 128 basic English characters (A-Z, digits, punctuation) to single bytes
- Lesson 1997 — What Is Character Encoding?
- Asian scripts
- Chinese characters ( 中⽂ ), Japanese (⽇本語 ), Korean (한국어 )
- Lesson 1998 — ASCII and Its Limitations
- Aspect-Oriented Programming (AOP)
- , which separates cross-cutting concerns (logging, security, transactions) from business logic.
- Lesson 2391 — Dynamic Proxies and AOP
- assignment
- you're putting a value into a variable.
- Lesson 141 — Common Pitfalls: Assignment vs ComparisonLesson 313 — Creating Objects: Using new with Constructors
- Associative
- `combiner(a, combiner(b, c))` must equal `combiner(combiner(a, b), c)`.
- Lesson 1511 — The Combiner Function in Parallel StreamsLesson 1513 — Common Pitfalls: Non-Associative Operations and Side Effects
- Associativity
- `(a op b) op c = a op (b op c)` (grouping doesn't matter)
- Lesson 1507 — Identity Element Requirements: Associativity and Neutrality
- At compile time
- , Java checks whether a method *exists* on the **reference type** (the declared type of your variable).
- Lesson 465 — The Role of the Reference Type at Compile TimeLesson 2240 — Line Terminator NormalizationLesson 2479 — Diagnosing Missing requires Declarations
- At construction time
- using a Thread constructor that accepts a name:
- Lesson 2566 — Thread Naming and Identification
- At critical save points
- where data loss would be unacceptable
- Lesson 1937 — flush: Forcing Buffered Data to Disk
- At declaration
- Assign the value immediately when you declare it
- Lesson 71 — final and Initialization Requirements
- at least one
- of them is `true`.
- Lesson 108 — Logical OR Operator: ||Lesson 117 — The Bitwise XOR Operator (^)Lesson 297 — Object ReachabilityLesson 1532 — Understanding Match Operations OverviewLesson 1680 — BiPredicate Composition: and, or, negate
- At least one thread
- will modify it (add, remove, update)
- Lesson 1247 — Why Collections Need Synchronization
- at runtime
- , not at compile time.
- Lesson 460 — What is Dynamic Dispatch?Lesson 465 — The Role of the Reference Type at Compile TimeLesson 2479 — Diagnosing Missing requires Declarations
- At the end
- → the stack should be empty (all brackets were matched)
- Lesson 1215 — Stack Operation Examples: Balanced Parentheses
- atomic
- (like check-then-update)
- Lesson 1247 — Why Collections Need SynchronizationLesson 2059 — ATOMIC_MOVE: Ensuring Move Atomicity
- Atomic Operations
- Methods like copy and move can be performed atomically when supported by the file system, preventing partial failures.
- Lesson 2034 — Overview of Files Utility Class and Basic Operations
- Audit Your Codebase
- Lesson 1903 — Migration Checklist and Common Pitfalls
- Autoboxing
- (e.
- Lesson 214 — Overloading with Autoboxing and VarargsLesson 215 — Common Overloading Pitfalls and AmbiguityLesson 220 — Method Overloading with VarargsLesson 876 — Type Arguments Cannot Be PrimitivesLesson 904 — Autoboxing with Generic CollectionsLesson 2345 — Handling Primitive Return Types and Autoboxing
- Autoboxing/unboxing
- for primitive types adds object creation overhead
- Lesson 2395 — Performance Overhead of Reflection
- Automatic cleanup
- both files close even if exceptions occur
- Lesson 1986 — Complete Example: Reading and Writing Text Files
- Automatic execution
- `readObject()` runs automatically—no explicit method call needed
- Lesson 2158 — Serialization as an Attack Vector
- Automatic flushing occurs when
- Lesson 1912 — The flush() Method for Output Streams
- Automatic handling
- Java serializes all non-transient fields
- Lesson 2157 — Externalizable vs Serializable: Trade-offs and Decision Guide
- automatic module
- .
- Lesson 2515 — Modular JARs vs Non-Modular JARs at RuntimeLesson 2535 — What Are Automatic Modules?Lesson 2539 — Automatic Modules Export All Packages
- Automatic modules
- – non-modular JARs that can be used on the module path
- Lesson 2525 — Assessing Your Application's Readiness for ModulesLesson 2527 — The Top-Down Migration Strategy
- Automatic queuing
- Tasks wait their turn without additional code
- Lesson 2720 — newFixedThreadPool: Creating a Fixed-Size Thread Pool
- Automatic type conversion
- Write primitives and objects directly without manual toString() calls
- Lesson 2016 — PrintWriter Overview: Formatted Text Output
- automatically
- calls `super()` as its very first action—even if you don't write it explicitly.
- Lesson 400 — The Subclass Constructor and Implicit super()Lesson 491 — Interface Constants: public static final by DefaultLesson 552 — IDE Generation and Records: Automatic Implementation
- AutoValue
- Generates value class implementations
- Lesson 2452 — What Are Annotation Processors?Lesson 2459 — Common Use Cases: Lombok, AutoValue, and Dagger
- Averaging collectors
- (`averagingInt`, `averagingLong`, `averagingDouble`) return **0.
- Lesson 1594 — Handling Empty Streams with Summing and Averaging Collectors
- Avoid
- having a module `com.
- Lesson 2464 — Module Naming Conventions and Best PracticesLesson 2783 — The get and join Methods: Blocking for Results
- Avoid `HashSet`
- for enums—it wastes memory and sacrifices performance for no benefit.
- Lesson 597 — Introduction to EnumSet: A Specialized Set for Enums
- Avoid `Hashtable`
- in modern code—if you need thread safety, use `ConcurrentHashMap` instead (covered later), which offers better concurrent performance
- Lesson 1153 — Hashtable vs HashMap: Key Differences
- Avoid `teeing` when
- Lesson 1614 — When to Use teeing vs Separate Collectors
- Avoid ambiguous signatures
- Two constructors with the same number and types of parameters will confuse the compiler.
- Lesson 324 — Choosing Constructor Overload Signatures
- Avoid frequent reallocations
- – Growing too slowly (like by a fixed amount) means resizing often as the list grows large.
- Lesson 1014 — The Growth Strategy: Multiplying Capacity by 1.5
- Avoid Over-General Catches Early
- Lesson 765 — Catch Order Best Practices
- Avoid overusing them
- importing too many static members can make code harder to read, as it becomes unclear where methods come from.
- Lesson 672 — Static Import: Importing Static Members
- Avoid static imports when
- Lesson 381 — Best Practices for static Imports
- Avoid symmetric parameter patterns
- (swapping types between parameters)
- Lesson 215 — Common Overloading Pitfalls and Ambiguity
- Avoid them when
- Lesson 378 — Wildcard static Imports
- Avoid uninitialized variable errors
- (the compiler knows your variable has a value from the start)
- Lesson 68 — Declaration and Initialization in One Statement
- Avoid unnecessary casts
- If you're frequently casting, reconsider your design
- Lesson 799 — ClassCastException and Type Safety
- Avoid wasting memory
- – Doubling capacity (2×) can waste significant space, especially for large lists.
- Lesson 1014 — The Growth Strategy: Multiplying Capacity by 1.5
- Avoiding name collisions
- Since Java is case-sensitive, `com.
- Lesson 680 — Package Name Case Conventions: All Lowercase
- Avoiding Time Zone Complexity
- Lesson 1875 — Use Cases for OffsetDateTime
- Avro
- provide compact binary formats with schema support.
- Lesson 2165 — Alternatives to Java Serialization
- Awareness
- Developers immediately know they're using risky APIs
- Lesson 2409 — @Deprecated: Compiler Warnings
B
- Back off gracefully
- release any locks you're holding and retry later
- Lesson 2698 — Timeouts and tryLock: Breaking Potential Deadlocks
- Back to step 2
- – Repeats condition → body → update until condition becomes `false`
- Lesson 166 — Executing for Loops: Step-by-Step Evaluation Order
- Backed by an Array
- Under the hood, `ArrayDeque` maintains a circular array.
- Lesson 1202 — What is ArrayDeque? Overview and Purpose
- Background Cleanup
- Lesson 2623 — Common Use Cases for Daemon Threads
- Backpressure handling
- When the queue reaches capacity, the executor can apply policies (reject tasks, block the submitter, etc.
- Lesson 2713 — Task Queues: Buffering Work for Thread Pools
- Backtrack or reverse direction
- Problems that require undoing steps or going backward through decisions (like maze solving, undo features, or balanced parentheses)
- Lesson 1218 — Stack vs Queue Trade-offs in Problem Solving
- backward compatibility
- with pre-generics Java code (before Java 5).
- Lesson 883 — Raw Type Syntax and DeclarationLesson 891 — What Is Type Erasure?Lesson 1034 — Enumeration: Vector's Legacy IteratorLesson 2000 — UTF-8: Variable-Length EncodingLesson 2414 — Built-In Annotations: When and Why to Use Each
- Backward traversal
- Lesson 1296 — Enhanced For Loop vs Traditional For Loop
- Bad example (unnecessary wildcard)
- Lesson 947 — PECS and Return Types: When Not to Use Wildcards
- Bad practice
- Modifying external variables or collections within stream operations creates **side effects** that break these guarantees.
- Lesson 1373 — Stream Operations Are Functional and Side-Effect Free
- Balanced entry/exit
- Every lock acquisition must have a matching release
- Lesson 2674 — Lock Acquisition Count: Entry and Exit Tracking
- Base case
- A simple condition where the method can return a result without calling itself again
- Lesson 224 — What is Recursion? A Method Calling ItselfLesson 225 — The Base Case: Preventing Infinite RecursionLesson 227 — Example: Computing Factorial RecursivelyLesson 232 — Converting Recursion to Iteration
- Base Case Never Reached
- Lesson 230 — Stack Overflow Error: When Recursion Goes Too Deep
- Basic email-like pattern
- Lesson 2301 — Quantifiers with Character Classes: Practical Patterns
- Basic pattern
- Lesson 1444 — flatMap with Arrays: Arrays.stream()
- Basic syntax
- Lesson 272 — Arrays.fill: Populating Arrays with ValuesLesson 1650 — Creating Function Instances with Lambdas
- Basic usage pattern
- Lesson 2499 — The java.util.ServiceLoader Class
- Be cautious with varargs
- they're chosen *last*, but can still create confusion
- Lesson 215 — Common Overloading Pitfalls and Ambiguity
- Be efficient and safe
- (using short-circuit evaluation when appropriate)
- Lesson 157 — Writing Effective while Loop Conditions
- Before (Anonymous Class)
- Lesson 651 — Basic Lambda Conversion: Removing BoilerplateLesson 657 — Practical Migration: Collections and Event Handlers
- Before (legacy code)
- Lesson 459 — Migrating Legacy Code to Pattern Matching
- Before checking file contents
- while the stream is still open
- Lesson 2121 — ObjectOutputStream.flush() and Stream Flushing
- Before critical operations
- Before starting a long computation where a crash would lose buffered data
- Lesson 1985 — flush: Forcing Buffer Contents to DiskLesson 2121 — ObjectOutputStream.flush() and Stream Flushing
- Before final consumption
- – normalize results before `thenAccept`
- Lesson 2852 — Combining handle with Other CompletableFuture Methods
- Before long operations
- Flush before starting a lengthy computation so partial results are saved.
- Lesson 1957 — flush() and When to Use It
- Before program termination
- (if you might not call `close()`)
- Lesson 1937 — flush: Forcing Buffered Data to Disk
- Before sleep
- Thread is in `RUNNABLE` state (either actively running or ready to run)
- Lesson 2592 — What Happens During sleep: Thread State Changes
- before the return type
- , making the method flexible regardless of whether the containing class is generic.
- Lesson 866 — Declaring Generic Methods: Type Parameter SyntaxLesson 869 — Generic Methods in Non- Generic ClassesLesson 915 — Bounded Type Parameters in Generic Methods
- Before the volatile write
- All preceding writes (including non-volatile ones) must be flushed to main memory.
- Lesson 2689 — volatile in the Java Memory Model: Formal Guarantees
- beginning
- of a collection, the two implementations behave dramatically differently due to their internal structures.
- Lesson 1038 — Time Complexity: Insertion at BeginningLesson 2213 — stripLeading() and stripTrailing(): Directional StrippingLesson 2249 — The lookingAt() Method: Prefix Matching
- Benchmark reality
- Reflective instantiation can be **10-100x slower** than direct instantiation, depending on the constructor complexity and security setup.
- Lesson 2378 — Performance and Security Considerations
- Benefit
- Compile-time verification that prevents runtime bugs, clearer intent for readers, automatic detection when refactoring breaks overrides
- Lesson 423 — Best Practices: Always Use @OverrideLesson 1065 — Choosing Load Factor: Space vs Time Trade-offsLesson 2440 — Choosing the Right Retention Policy
- Best case
- Removing from known head/tail is O(1) total
- Lesson 1041 — Time Complexity: Removal Operations
- Best for
- Standard objects, rapid development, when default behavior suffices
- Lesson 2157 — Externalizable vs Serializable: Trade-offs and Decision Guide
- Best practice
- Use only immutable fields (like IDs) or accept that modifying objects in hash-based collections is forbidden.
- Lesson 549 — Common equals and hashCode MistakesLesson 1646 — Short-Circuit Evaluation in Predicate ChainsLesson 2413 — @SuppressWarnings: Scope and Best PracticesLesson 2464 — Module Naming Conventions and Best PracticesLesson 2699 — Avoiding Nested Locks and Minimizing Lock Scope
- best-effort
- or indicates a programming error, use an unchecked exception or swallow the error
- Lesson 826 — Exceptions in close()Lesson 1300 — What Is Fail-Fast Behavior?
- Best-effort search
- Multiple search strategies where any acceptable result is sufficient
- Lesson 2767 — Use Cases: invokeAll vs invokeAny
- Better alternatives exist
- that are more explicit and reliable
- Lesson 577 — Deprecation of finalize in Java 9+Lesson 1030 — What Is Vector: A Legacy Synchronized List
- Better choices
- Lesson 683 — Best Practices: Meaningful Package Names
- Better exception handling
- Suppressed exceptions are tracked, not lost
- Lesson 838 — Try-With-Resources vs Traditional Try-FinallyLesson 2025 — Introduction to NIO.2 and the Path InterfaceLesson 2034 — Overview of Files Utility Class and Basic Operations
- Better for large datasets
- Especially important when processing millions of records or expensive computations
- Lesson 1613 — Performance Benefits of teeing Over Multiple Passes
- Better performance
- `ArrayDeque` typically outperforms `Stack` due to its efficient circular array implementation
- Lesson 1211 — Why Deque Is Preferred Over Stack ClassLesson 1409 — No Intermediate StorageLesson 2157 — Externalizable vs Serializable: Trade-offs and Decision Guide
- Better security
- Text-based formats like JSON don't execute code during parsing
- Lesson 2165 — Alternatives to Java Serialization
- Between `thenCompose` stages
- – recover from one async operation before starting the next
- Lesson 2852 — Combining handle with Other CompletableFuture Methods
- Bidirectional traversal
- Move forward *and* backward through your list.
- Lesson 1282 — The ListIterator Interface Overview
- Binary
- (`0b`): useful when working with individual bits or flags
- Lesson 35 — Binary, Octal, and Hexadecimal Integer LiteralsLesson 43 — Floating-Point Arithmetic and Rounding ErrorsLesson 56 — Integer Literals: Decimal, Hexadecimal, Octal, and Binary
- Binary data
- consists of raw bytes that represent non-textual information: images (`.
- Lesson 1930 — Binary Data vs Text DataLesson 1967 — Reader vs InputStream: When to Use Which
- Binary Operators
- (two inputs, one output, all the same type):
- Lesson 1688 — Primitive Specializations: IntUnaryOperator, LongBinaryOperator, etc.
- Binary search
- Check the middle, search left *or* right half recursively
- Lesson 233 — When to Use Recursion: Tree Traversal and Divide-and-Conquer
- BinaryOperator
- Combines two values of the same type into one (you've used this with `reduce`)
- Lesson 1629 — Common Functional Interfaces in java.util.function
- Bind
- "If yes, give me a Dog-typed variable I can use immediately.
- Lesson 453 — Pattern Matching for instanceof: Basic Syntax
- Birthdays
- You were born on a specific date, not at a specific instant in UTC
- Lesson 1836 — LocalDate: Representing Dates Without Time
- bits
- binary digits that are either 0 or 1.
- Lesson 114 — Introduction to Bitwise OperationsLesson 122 — Bitwise vs Logical Operators: & vs &&, | vs ||
- Bitwise context (bit manipulation)
- Lesson 122 — Bitwise vs Logical Operators: & vs &&, | vs ||
- bitwise operators
- that let you manipulate individual bits within a number.
- Lesson 114 — Introduction to Bitwise OperationsLesson 122 — Bitwise vs Logical Operators: & vs &&, | vs ||
- Blanket synchronization hurts performance
- Even when you're using `Vector` in single-threaded code (the most common case), you pay the cost of acquiring and releasing locks on every operation.
- Lesson 1030 — What Is Vector: A Legacy Synchronized List
- block body
- comes in.
- Lesson 1704 — Block Body: Multiple Statements with BracesLesson 1705 — Explicit return in Block Bodies
- Block body (multiple statements)
- Lesson 1704 — Block Body: Multiple Statements with Braces
- Blocked
- Accessing through a superclass-typed reference pointing to a different subclass instance
- Lesson 719 — Protected Reference Type RestrictionsLesson 2580 — Thread States Overview: The Five-State ModelLesson 2584 — BLOCKED State: Waiting for Monitor LockLesson 2592 — What Happens During sleep: Thread State ChangesLesson 2703 — Detecting Livelock vs Deadlock
- Blocking
- `invokeAll` doesn't return until all tasks finish
- Lesson 2758 — invokeAll: Executing Multiple Callables
- Blocking I/O operations
- (file/network reads): The common pool's threads would sit idle, starving other tasks
- Lesson 2781 — Async Execution Models: Common vs Custom ExecutorsLesson 2866 — Why Custom Executors Matter: Isolation and Resource Control
- Blocking only
- You must call `get()` and block until completion
- Lesson 2777 — What is CompletableFuture and Why Use It?
- blocks
- (waits) until an event occurs.
- Lesson 2098 — The WatchKey and Polling for EventsLesson 2655 — Only One Thread Executes at a TimeLesson 2693 — Visualizing the Circular WaitLesson 2741 — The get() Method: Blocking Until Completion
- boolean
- values **cannot** be compared using `<`, `>`, `<=`, or `>=` — only `==` and `!
- Lesson 106 — Comparison Operators and Type CompatibilityLesson 237 — Default Initialization ValuesLesson 307 — Field Initialization: Default ValuesLesson 2133 — Default Values After DeserializationLesson 2773 — awaitTermination(): Waiting for Shutdown Completion
- Boolean context (logic operations)
- Lesson 122 — Bitwise vs Logical Operators: & vs &&, | vs ||
- boolean expression
- is any piece of code that evaluates to either `true` or `false`.
- Lesson 54 — Boolean Expressions and Comparison ResultsLesson 157 — Writing Effective while Loop Conditions
- Boom
- The compiler stops you immediately, preventing a breaking change that would invalidate all existing lambda usage.
- Lesson 2417 — Using @FunctionalInterface with Custom Interfaces
- both
- sides are true.
- Lesson 107 — Logical AND Operator: &&Lesson 108 — Logical OR Operator: ||Lesson 115 — The Bitwise AND Operator (&)Lesson 117 — The Bitwise XOR Operator (^)Lesson 456 — Pattern Matching with Logical OperatorsLesson 770 — Exception Chaining with initCause and ConstructorsLesson 816 — Constructors: Message, Cause, and BothLesson 859 — Diamond Operator: Type Inference in Constructors (+12 more)
- both ends
- .
- Lesson 1193 — What Is a Deque? Double-Ended Queue ExplainedLesson 1196 — Offer and Poll Variants: offerFirst, offerLast, pollFirst, pollLast
- Both resources
- declared in one try-with-resources statement
- Lesson 1986 — Complete Example: Reading and Writing Text Files
- bound
- (the type constraint, if any) or with `Object` if no bound exists.
- Lesson 891 — What Is Type Erasure?Lesson 894 — Bounded Type Parameters Become Their Bound
- Bound instance method reference
- Lesson 1651 — Method References as Function Implementations
- Bounded
- `ArrayBlockingQueue`, circular buffer implementations—fixed capacity set at creation
- Lesson 1172 — Queue Capacity Restrictions and Bounded Queues
- Bounded concurrency
- Limits parallel execution to prevent system overload
- Lesson 2720 — newFixedThreadPool: Creating a Fixed-Size Thread Pool
- Bounded thread pools
- to prevent resource exhaustion
- Lesson 2790 — Providing a Custom Executor to supplyAsync
- bounded type parameters
- (like `<T extends Number>`), the erasure works differently: the type parameter is erased to its **bound** instead of `Object`.
- Lesson 894 — Bounded Type Parameters Become Their BoundLesson 910 — What Are Bounded Type Parameters?
- bounds checking
- .
- Lesson 245 — ArrayIndexOutOfBoundsException and Bounds CheckingLesson 795 — ArrayIndexOutOfBoundsException and Bounds Checking
- Boxes
- your `5` and `10` primitives into `Integer` objects
- Lesson 2401 — Autoboxing Penalties in Reflective Method Calls
- Boxing is unavoidable anyway
- data already comes from a `List<Integer>`
- Lesson 1698 — When to Use Primitive Specializations vs Generics
- Boxing/unboxing primitives
- All arguments pass through `Object[]`, forcing autoboxing
- Lesson 2350 — Performance Costs of Reflective Invocation
- Breaking Encapsulation Intentionally
- When you use `opens`, you're explicitly allowing reflection to bypass the strong encapsulation that `exports` enforces.
- Lesson 2497 — Security and Design Trade-offs with opens
- Breaking it down
- Lesson 2282 — Matching Email Addresses with Regex
- Buffered efficiency
- `BufferedReader`'s internal buffer minimizes disk reads
- Lesson 2014 — Processing Large Files with readLine
- Buffered I/O
- (which you'll learn next) is like using a shopping cart to buy everything in one trip—far more efficient.
- Lesson 1932 — The Problem with Unbuffered I/O: System Call Overhead
- Buffered reading
- One system call fills the entire buffer with many bytes.
- Lesson 1951 — Unbuffered vs Buffered I/O: Performance Impact
- Buffered writing
- Bytes accumulate in the buffer.
- Lesson 1951 — Unbuffered vs Buffered I/O: Performance Impact
- Buffering
- When a producer generates data faster than a consumer can process it, a queue acts as a shock absorber.
- Lesson 1174 — Queue Use Cases: Task Scheduling and BufferingLesson 1986 — Complete Example: Reading and Writing Text FilesLesson 2713 — Task Queues: Buffering Work for Thread Pools
- Build tools and frameworks
- in your stack don't yet fully support JPMS
- Lesson 2524 — Migration Strategy: When to Use Module Path vs Classpath
- Build tools handle it
- Maven, Gradle, and IDEs manage classpaths automatically
- Lesson 691 — The CLASSPATH Environment Variable
- Build-time verification
- Static analysis tools can check `.
- Lesson 2436 — RetentionPolicy.CLASS Explained
- Built-in buffering
- PrintWriter buffers internally for efficiency
- Lesson 2016 — PrintWriter Overview: Formatted Text Output
- Built-in versioning
- `serialVersionUID` manages evolution
- Lesson 2157 — Externalizable vs Serializable: Trade-offs and Decision Guide
- byte level
- .
- Lesson 1930 — Binary Data vs Text DataLesson 1959 — The Reader Hierarchy: Character-Based Input
- bytecode
- .
- Lesson 12 — Compiling with javacLesson 19 — What is Bytecode? The Bridge Between Source and Machine Code
- Bytecode Instructions
- Lesson 23 — Inside a .class File: Structure and Contents
- Bytecode processors
- Tools like ASM or ByteBuddy can read these annotations to modify or analyze compiled code
- Lesson 2436 — RetentionPolicy.CLASS Explained
C
- C#
- and **Kotlin** chose a different path called **reified generics**, where type parameters remain available at runtime.
- Lesson 966 — Reified Generics in Other Languages: What Java Lacks
- Cache-friendly
- Sequential memory layout improves CPU cache utilization
- Lesson 603 — EnumMap Performance: Array-Based ImplementationLesson 1392 — Collection.stream() vs Arrays.stream() Performance Considerations
- Cached pool
- Flexible scaling, better for sporadic workloads, risk of creating too many threads
- Lesson 2865 — Creating Dedicated Thread Pools for CompletableFuture
- Calculations
- Finding all unique results from mathematical transformations
- Lesson 1483 — Using distinct After Transformations
- Call `equals()`
- to find the exact match within that bucket
- Lesson 546 — Why hashCode Matters for Hash-Based Collections
- Call `getCause()`
- to retrieve the original exception
- Lesson 2753 — Handling ExecutionException from Callable Failures
- Call `hashCode()`
- to find the bucket
- Lesson 546 — Why hashCode Matters for Hash-Based CollectionsLesson 554 — How HashMap Uses hashCode for Bucket Selection
- Call `setAccessible(true)`
- on the Method object
- Lesson 2363 — Invoking Private Methods with setAccessible
- call stack
- has limited memory.
- Lesson 230 — Stack Overflow Error: When Recursion Goes Too DeepLesson 748 — What Is the Call Stack?Lesson 749 — Normal Stack Unwinding
- Call the method again
- Pass the simpler arguments to itself
- Lesson 226 — The Recursive Case: Breaking Down the Problem
- Calls `map.put(e, PRESENT)`
- your element becomes a key, paired with the dummy value
- Lesson 1049 — HashSet add: Calling HashMap put
- Calls a blocking method
- that responds to interruption (like `Thread.
- Lesson 2599 — What Is Thread Interruption?
- camelCase
- start with lowercase, capitalize each new word (like `studentScore` or `maxHeight`).
- Lesson 65 — Variable Declaration SyntaxLesson 204 — Method Naming Conventions: Verbs and Clarity
- can
- change return types when signatures differ:
- Lesson 211 — Return Type Does Not Affect OverloadingLesson 487 — What Is an Interface? The Contract MetaphorLesson 788 — Why Unchecked Exceptions Don't Require DeclarationLesson 951 — Reading from Unbounded Wildcard Collections
- Can have access modifiers
- (public, protected, package-private—not private)
- Lesson 480 — Abstract Method Syntax and Rules
- Can have constructors
- You write constructors to initialize the abstract class's fields when subclasses are created.
- Lesson 495 — Interfaces vs Abstract Classes: Initial Comparison
- Can have instance fields
- Abstract classes can maintain state that all subclasses inherit and share access to.
- Lesson 495 — Interfaces vs Abstract Classes: Initial Comparison
- Cancels remaining tasks
- Once a task succeeds, the executor attempts to cancel the others to avoid wasting resources.
- Lesson 2763 — invokeAny: Racing Multiple Callables
- cannot
- start or end a number with an underscore: `_123` or `123_` are illegal
- Lesson 63 — Underscores in Numeric Literals for ReadabilityLesson 64 — Rules and Restrictions for Underscores in LiteralsLesson 106 — Comparison Operators and Type CompatibilityLesson 172 — Enhanced for Loop Limitations: No Index or ModificationLesson 211 — Return Type Does Not Affect OverloadingLesson 316 — What is this? The Implicit Object ReferenceLesson 331 — Access Modifiers on ClassesLesson 421 — Checked Exceptions in Overriding Methods (+13 more)
- cannot be accessed
- .
- Lesson 2087 — FileVisitor Interface and Its MethodsLesson 2485 — Public Types in Non-Exported Packages Are Inaccessible
- Cannot check type parameters
- You can't write `if (item instanceof T)` because `T` doesn't exist at runtime—only `Object` does
- Lesson 893 — Type Parameters Become Object
- Cantor Principle
- (named after set theory): the contract is one-directional, not bidirectional.
- Lesson 551 — The Cantor Principle: Why the Contract Is Not Bidirectional
- capacity
- is how many the backing array can hold before needing to grow.
- Lesson 1002 — Initial Capacity and the Default ConstructorLesson 1004 — The size vs capacity DistinctionLesson 1009 — trimToSize: Reclaiming Unused CapacityLesson 1011 — ArrayList's Internal Array and Capacity ConceptLesson 1013 — Triggering a Resize: When Capacity Is ExhaustedLesson 1059 — Capacity vs Size in HashSetLesson 1123 — Understanding Load Factor: Capacity vs Size
- capacity doubling
- .
- Lesson 1207 — Array Growth and Capacity DoublingLesson 1208 — Performance Characteristics: O(1) Operations
- Capacity Management
- Tracking available resource slots (like parking spaces numbered 1-100) where you need to quickly find the lowest available number (`pollFirst()`) or check what's available above/below a threshold.
- Lesson 1101 — TreeSet as NavigableSet: Practical Applications
- capture conversion
- it invents a fresh, invisible type parameter to represent "whatever specific type this wildcard actually is.
- Lesson 954 — Introduction to Capture ConversionLesson 956 — Capture Helper Methods Pattern
- Capture results
- Store values computed inside a loop or conditional for use later
- Lesson 191 — Declaring Variables Before Control Structures
- Capture the Current Head
- Lesson 1025 — Removing the First Element
- Capture the stack trace
- – The JVM walks through the entire call stack, recording every method call to build the detailed stack trace you see when debugging
- Lesson 755 — Performance Impact of Unwinding
- captures
- any exception thrown by your task and stores it inside the returned `Future` object.
- Lesson 2734 — Exception Handling with submit: Future.get ThrowsLesson 2793 — Exception Handling in supplyAsync
- Cargo (element)
- The actual data you're storing (a String, Integer, or any object)
- Lesson 1020 — Node Structure in LinkedList
- Case-insensitive
- User input where "March" vs "march" shouldn't matter
- Lesson 1893 — Case Sensitivity and Strict vs Lenient Parsing
- case-sensitive
- .
- Lesson 148 — Switch with String and Enum TypesLesson 1893 — Case Sensitivity and Strict vs Lenient ParsingLesson 2202 — The replace Method: Replacing Substrings
- Cast
- to that type
- Lesson 452 — The Boilerplate Problem: Test-Cast-Use PatternLesson 799 — ClassCastException and Type Safety
- Cast the lambda explicitly
- to the desired functional interface type
- Lesson 1715 — Inference Limitations and Ambiguity
- Catch `ExecutionException`
- when calling `Future.
- Lesson 2753 — Handling ExecutionException from Callable Failures
- catch block
- comes in.
- Lesson 730 — The catch Block: Handling Specific Exception TypesLesson 835 — Combining Try-With- Resources and Finally
- Catch the exception
- Lesson 2776 — RejectedExecutionException After Shutdown
- cause
- of the new `RuntimeException`.
- Lesson 770 — Exception Chaining with initCause and ConstructorsLesson 816 — Constructors: Message, Cause, and BothLesson 2372 — Constructor.newInstance(): Creating Objects
- Caution
- Overusing `import static *` can make code less readable—it's unclear where members come from.
- Lesson 377 — Importing Static Methods and Fields
- Caveat
- External code can also synchronize on `this`, potentially causing unintended contention or deadlock.
- Lesson 2663 — Choosing the Lock Object
- chain
- simple comparators together.
- Lesson 1361 — Chaining Comparators for Multi-Level SortingLesson 2805 — thenApply vs map in Stream API
- Chain further operations
- Attach another `thenRun()`, `thenAccept()`, or exception handlers
- Lesson 2810 — Return Types: CompletableFuture<Void> for Both Methods
- Chain operations
- `product -> product.
- Lesson 1339 — Comparator.comparing() with Lambda ExpressionsLesson 2777 — What is CompletableFuture and Why Use It?
- Chain to maximize reuse
- Always have simpler constructors call more complex ones using `this()`.
- Lesson 324 — Choosing Constructor Overload Signatures
- Chainability
- Since methods return new objects, you can chain operations cleanly:
- Lesson 1899 — Replacing Calendar Arithmetic with Period and Duration
- Chainable
- You can call `thenApply` multiple times to build a pipeline
- Lesson 2797 — What thenApply Does: Synchronous Transformation
- Chaining operations with andThen
- Lesson 1660 — Consumer in forEach: Iterating Collections
- Change implementation
- Modify internal storage without breaking external code
- Lesson 723 — Prefer private Fields with Controlled Public Methods
- Change it
- when you make **incompatible changes** that would break deserialization anyway:
- Lesson 2130 — Best Practices for serialVersionUID Management
- Change the `serialVersionUID`
- explicitly to signal incompatibility (deserializing old data will fail fast)
- Lesson 2164 — Versioning Problems and Class Evolution
- Changes not reflected
- Modifications made after iterator creation won't appear during iteration
- Lesson 1305 — What Is Fail-Safe Behavior?
- Changing a field's type
- A String becoming an int can't be safely converted
- Lesson 2126 — Compatible vs Incompatible Class Changes
- Changing field access modifiers
- (private to public, etc.
- Lesson 2126 — Compatible vs Incompatible Class Changes
- Changing field types
- A field that was `String` is now `Integer`
- Lesson 2164 — Versioning Problems and Class Evolution
- Changing the `serialVersionUID`
- explicitly without handling compatibility
- Lesson 2126 — Compatible vs Incompatible Class Changes
- Changing the class hierarchy
- Moving or removing superclasses
- Lesson 2126 — Compatible vs Incompatible Class Changes
- char
- `'\u0000'` (the null character, essentially zero)
- Lesson 237 — Default Initialization ValuesLesson 307 — Field Initialization: Default Values
- Character class
- matching one or more valid local-part characters
- Lesson 2282 — Matching Email Addresses with Regex
- character encoding
- (UTF-8, UTF-16, ISO-8859-1, etc.
- Lesson 1959 — The Reader Hierarchy: Character-Based InputLesson 2047 — Character Encoding with Charset Parameters
- characters
- (represented as `char` in Java, which are 16-bit Unicode units).
- Lesson 1959 — The Reader Hierarchy: Character-Based InputLesson 1962 — Reader's Core Methods: read(), read(char[]), and skip()
- Cheap computation
- (like a literal or existing variable):
- Lesson 1789 — Performance Comparison: orElse vs orElseGet
- Check before submitting
- Lesson 2776 — RejectedExecutionException After Shutdown
- Check before using
- Lesson 794 — NullPointerException: The Most Common Runtime Error
- Check before you cast
- Always use `instanceof` when the type is uncertain
- Lesson 799 — ClassCastException and Type Safety
- Check the line above
- too—sometimes the real mistake is earlier
- Lesson 14 — Understanding Compilation Errors
- Check the source
- Know whether your collection is already synchronized before wrapping it
- Lesson 1253 — Nested Synchronized Wrapper Anti-Pattern
- Check-then-act patterns work safely
- no other thread can change conditions between the check and the action
- Lesson 2649 — Why Single-Threaded Code Doesn't Have These Issues
- Checked
- All subclasses of `Exception` (except `RuntimeException` and its descendants)
- Lesson 783 — The Two Categories: Checked and Unchecked ExceptionsLesson 811 — ReflectiveOperationException HierarchyLesson 812 — Choosing Between Checked and UncheckedLesson 814 — Extending Exception for Checked Exceptions
- checked exception
- but doesn't catch it itself, Java requires you to advertise this fact in the method's signature using the `throws` clause.
- Lesson 743 — Method Signatures and throws DeclarationLesson 784 — What Makes an Exception Checked?Lesson 786 — The throws Clause: Declaring Checked ExceptionsLesson 805 — IOException: File and Stream OperationsLesson 807 — ClassNotFoundException and NoClassDefFoundErrorLesson 809 — ParseException: Data Parsing FailuresLesson 810 — CloneNotSupportedException: Cloning RestrictionsLesson 812 — Choosing Between Checked and Unchecked (+4 more)
- Checked exceptions
- that your method doesn't catch must be declared with `throws`
- Lesson 743 — Method Signatures and throws DeclarationLesson 783 — The Two Categories: Checked and Unchecked ExceptionsLesson 792 — Overriding Methods and Exception CompatibilityLesson 812 — Choosing Between Checked and UncheckedLesson 2783 — The get and join Methods: Blocking for Results
- Checking flags
- (reading bits) uses the `&` operator:
- Lesson 123 — Practical Uses: Bit Flags and Masking
- Checking relationships between objects
- Lesson 1679 — BiPredicate<T, U>: Two-Argument Boolean Tests
- Choose "Getter and Setter"
- Lesson 347 — IDE Generation and Refactoring Tools for Accessors
- Choose `break`
- when: You need to stop the entire loop early (found a match, hit an error condition, reached a limit)
- Lesson 178 — break vs continue: When to Use Each
- Choose `continue`
- when: You want to skip processing for specific cases but keep checking remaining items (filtering, validation)
- Lesson 178 — break vs continue: When to Use Each
- Choose `runAsync` for
- Logging, sending notifications, cache updates, cleanup tasks — actions without meaningful results.
- Lesson 2792 — When to Use supplyAsync vs runAsync
- Choose `supplyAsync` for
- Database queries, API calls, complex calculations, file reading — anything producing data.
- Lesson 2792 — When to Use supplyAsync vs runAsync
- Choose `thenAccept` if
- Lesson 2813 — Choosing Between thenAccept and thenRun
- Choose `thenRun` if
- Lesson 2813 — Choosing Between thenAccept and thenRun
- Choose an Interface when
- Lesson 532 — Decision Criteria: A Practical Checklist
- Choose Collections.synchronizedMap when
- Lesson 1166 — When to Use ConcurrentHashMap vs Synchronized HashMap
- Choose ConcurrentHashMap when
- Lesson 1166 — When to Use ConcurrentHashMap vs Synchronized HashMap
- Choose filter().findAny() when
- Lesson 1540 — Performance Considerations and Use Cases
- Choose match operations when
- Lesson 1540 — Performance Considerations and Use Cases
- Circular references
- are equally dangerous: Object X references Y, Y references X.
- Lesson 2160 — The Billion Laughs Attack and Resource Exhaustion
- Clarifies intent
- Signals "this doesn't depend on object state"
- Lesson 367 — Common Use Cases for static Methods: Utility Functions
- Clarity
- Signals to other programmers which values are constant
- Lesson 345 — Read-Only Properties: Getters Without SettersLesson 403 — The super Keyword: Accessing Superclass MembersLesson 1645 — Predicates for Validation and Business RulesLesson 1899 — Replacing Calendar Arithmetic with Period and DurationLesson 1992 — StandardCharsets for Common Encodings
- Clarity of intent
- When someone reads your production code, every operation should serve the business logic.
- Lesson 1462 — Removing peek in Production Code
- class
- is like a blueprint or template in Java.
- Lesson 304 — What Is a Class? Blueprint for ObjectsLesson 920 — What Are Multiple Bounds in Generics?Lesson 2379 — Annotation Retention and Runtime AvailabilityLesson 2425 — Element Types: Primitives, Strings, and ClassesLesson 2432 — What Are Retention Policies?
- CLASS annotations
- persist in bytecode for bytecode analysis tools but aren't loaded into memory when the JVM runs your program.
- Lesson 2379 — Annotation Retention and Runtime Availability
- Class file size
- Increases (annotations stored in bytecode)
- Lesson 2441 — Retention Policy and Performance Implications
- Class first (if present)
- If you're bounding by a class, it *must* come first
- Lesson 921 — Syntax: Combining extends with &
- Class name
- = the main section divider inside
- Lesson 9 — Anatomy of a Java Source FileLesson 676 — What Is a Fully Qualified Name (FQN)?
- Class object
- itself, not on any particular instance.
- Lesson 2665 — Class-Level Locks with synchronized(ClassName.class)
- Class-level (static)
- The blueprint itself might track "How many houses have been built from this blueprint?
- Lesson 358 — What static Means: Class-Level vs Instance-Level
- Class-level type parameters
- are declared on the class itself and are visible throughout the entire class—in all instance fields, constructors, and methods.
- Lesson 862 — Type Parameter Scope: Class-Level vs Method-Level
- Class-Path
- Lists external JAR files or directories your application needs:
- Lesson 686 — The JAR Manifest File
- Classes themselves
- that need to be used across your application
- Lesson 329 — public: Universal Accessibility
- Classes Win Over Interfaces
- Lesson 511 — The Diamond Problem and Resolution Rules
- classifier function
- a function that extracts or computes the grouping key for each element.
- Lesson 1567 — Introduction to groupingBy: Collecting into MapsLesson 1568 — Basic groupingBy Syntax and Classifier FunctionsLesson 1569 — Simple Grouping: Grouping by Property
- ClassNotFoundException
- occurs when you explicitly try to load a class (like with reflection or dynamic loading) and it's simply not on the classpath:
- Lesson 693 — Common Classpath Issues and ClassNotFoundException
- classpath
- is a list of locations that tells the Java Virtual Machine (JVM) where to search for class files when your program executes.
- Lesson 689 — The Classpath: Finding Classes at RuntimeLesson 2516 — Classpath Mechanics: How the JVM Finds ClassesLesson 2519 — Mixing Module Path and Classpath: Compatibility ModeLesson 2520 — Class Loading Differences: Modules vs ClasspathLesson 2521 — Encapsulation Enforcement on Module PathLesson 2522 — Split Packages: The Problem JPMS Solves
- Classpath order problems
- If you have multiple versions of the same class, the wrong one might load first.
- Lesson 693 — Common Classpath Issues and ClassNotFoundException
- Classpath Workaround
- Lesson 2528 — Handling Split Packages Across Dependencies
- Clean APIs
- with public interfaces separated from internal implementation
- Lesson 2525 — Assessing Your Application's Readiness for Modules
- Clean chaining
- Works smoothly with modern Comparator factory methods:
- Lesson 1357 — Sorting Lists with List.sort()
- Clean Up References
- Lesson 1025 — Removing the First Element
- Clean, safe, and concise
- The resource closes automatically—even if exceptions occur.
- Lesson 838 — Try-With-Resources vs Traditional Try-Finally
- Cleaner API
- (Java 9+) for rare cases needing cleanup hooks
- Lesson 574 — The finalize Method: Legacy Cleanup Mechanism
- Cleaner code
- No index variable cluttering your logic
- Lesson 173 — Iterating Arrays with Enhanced for LoopsLesson 859 — Diamond Operator: Type Inference in Constructors
- Clear distinction from classes
- Classes follow PascalCase (like `MyClass`), so lowercase packages make it immediately obvious what's a package and what's a class.
- Lesson 680 — Package Name Case Conventions: All Lowercase
- Clear purpose
- The type parameter `E` obviously represents the element type
- Lesson 900 — ArrayList<E> as the Canonical Generic Collection
- Clear stack semantics
- Methods like `push()`, `pop()`, and `peek()` work exactly as expected
- Lesson 1211 — Why Deque Is Preferred Over Stack Class
- Clearer API boundaries
- When your module exports only 2-3 packages instead of 10, users immediately understand what they should depend on.
- Lesson 2488 — Best Practices: Minimizing Exported API Surface
- Clearer intent
- You're modifying the variable, not creating a new value
- Lesson 129 — Assignment Operators: =, +=, -=, *=, /=, %=
- Clearer separation of concerns
- `Path` represents locations; the `Files` utility class performs operations
- Lesson 2025 — Introduction to NIO.2 and the Path Interface
- Clears the interruption flag
- (resets it to `false`)
- Lesson 2602 — Checking and Clearing: Thread.interrupted()
- Cloning final fields
- Remember, `clone()` conflicts with `final` fields when you need to replace them with deep copies.
- Lesson 570 — Clone Best Practices and Common Pitfalls
- Close the resource
- Closing the underlying stream/socket from another thread will cause the blocked operation to fail with an exception
- Lesson 2607 — Interruption and Non-Interruptible Blocking
- Closed connections
- Trying to use a connection that's already been closed
- Lesson 806 — SQLException: Database Access Errors
- Closed hierarchies
- (with `final`) enforce boundaries—think `String` or `Integer`.
- Lesson 431 — Design Decisions: When to Use final
- Closing tags
- Lesson 2290 — HTML Tag Matching and Extraction
- Cluttered
- The ceremony obscures your actual logic
- Lesson 452 — The Boilerplate Problem: Test-Cast-Use Pattern
- Coarse-grained
- Large synchronized blocks or entire methods.
- Lesson 2666 — Synchronized Block Scope and Granularity
- coarse-grained locking
- one big lock protecting the entire data structure.
- Lesson 1154 — Synchronization Overhead in HashtableLesson 2660 — When to Use Synchronized Methods
- Code clarity
- Makes your intent explicit to other developers
- Lesson 2414 — Built-In Annotations: When and Why to Use EachLesson 2641 — ThreadLocal Alternatives and When to Avoid It
- Code generation
- Adding proper indentation to generated source code
- Lesson 2221 — The indent Method: Adding Leading Whitespace
- Code generation tools
- that scan source files before compilation
- Lesson 2434 — RetentionPolicy.SOURCE Explained
- Code reusability
- One ArrayList implementation works for all reference types because `Object` is the universal superclass
- Lesson 1001 — The Object Array Backing Store
- Code reuse
- Write common behavior once in the superclass
- Lesson 393 — What Is Inheritance? The extends KeywordLesson 481 — Concrete Methods in Abstract ClassesLesson 522 — Private Static Methods in InterfacesLesson 855 — What Are Generics and Why They Matter
- Cohesive packages
- that logically group related functionality
- Lesson 2525 — Assessing Your Application's Readiness for Modules
- Collaborator Access
- Lesson 1246 — When to Use Unmodifiable Collections
- Collapsing blank lines
- Lesson 2291 — Whitespace Normalization Patterns
- Collecting to Custom Collections
- Lesson 1585 — Collecting to Different Data Structures per Partition
- Collecting to Sets
- Use `Collectors.
- Lesson 1571 — Downstream Collectors: Transforming Grouped ValuesLesson 1585 — Collecting to Different Data Structures per Partition
- Collection API methods
- (`contains()`, `addAll()`, etc.
- Lesson 1502 — Comparing toArray() with collect(toList())
- Collection phase
- Iterate through all `Future` objects, calling `get()` to retrieve each result
- Lesson 2748 — Practical Pattern: Submitting Multiple Tasks and Collecting Results
- Collections Framework
- is Java's standardized architecture for representing and manipulating groups of objects.
- Lesson 967 — The Collections Framework: Purpose and Design
- Collections Holding Non-Serializable Objects
- Lesson 2109 — Common NotSerializableException Scenarios
- Collections that grow indefinitely
- Lesson 301 — Memory Leaks in Java
- Collections.singleton(element)
- Returns an immutable Set containing one element:
- Lesson 1255 — Collections.singleton, singletonList, and singletonMap
- Collections.singletonList(element)
- Returns an immutable List containing one element:
- Lesson 1255 — Collections.singleton, singletonList, and singletonMap
- Collections.singletonMap(key, value)
- Returns an immutable Map containing one key-value pair:
- Lesson 1255 — Collections.singleton, singletonList, and singletonMap
- Collections.sort(List, Comparator)
- Lesson 1334 — Passing Comparators to Sort Methods
- Collections.synchronizedMap
- is a *wrapper* that takes any `Map` implementation and adds synchronization around it.
- Lesson 1156 — Thread Safety: Hashtable vs Collections.synchronizedMapLesson 1166 — When to Use ConcurrentHashMap vs Synchronized HashMap
- Collision clusters
- Bad luck or bad hashing creates "hot" buckets
- Lesson 1112 — Performance Characteristics: O(1) Average Case
- Collision prevention
- Different teams can work independently without naming conflicts
- Lesson 658 — What Are Packages and Why They Matter
- Combinatorial explosion
- The number of possible lock acquisition sequences grows factorially with more threads and resources, making testing nearly impossible.
- Lesson 2694 — Deadlock with Multiple Threads and Resources
- Combine
- multiple defaults: you could call both `Flying.
- Lesson 500 — Using super to Call Specific Default MethodLesson 1477 — Combining takeWhile and dropWhileLesson 1815 — Combining or with map and flatMapLesson 2299 — Union and Intersection in Character Classes
- Combine with other futures
- using functional composition
- Lesson 2777 — What is CompletableFuture and Why Use It?
- Combined width and precision
- Lesson 2020 — Format Specifiers: %s, %d, %f, and More
- Combiner
- Merges two containers together (for parallel stream support)
- Lesson 1515 — The Three-Argument collect OverloadLesson 1618 — Combiner: Merging Partial Results in Parallel StreamsLesson 1619 — Finisher: Transforming the Accumulator to Final ResultLesson 1622 — Custom Collector Example: Immutable Collection
- Common Cases First
- Lesson 765 — Catch Order Best Practices
- Common pattern
- Counting and looping by ones is ubiquitous in programming
- Lesson 96 — Increment and Decrement Operators: ++ and --
- Common scenario
- Your application uses a persistence framework (like Hibernate) that needs reflective access to your entity classes.
- Lesson 2493 — Qualified opens: Opening Packages to Specific Modules
- Common scenarios
- Lesson 1665 — What is Supplier<T> and When to Use It
- Common use cases
- Lesson 1639 — The Predicate<T> Interface and Its test Method
- Common warning types
- Lesson 2411 — @SuppressWarnings: Silencing Compiler Warnings
- Communicates intent
- Tells developers "this interface is designed for lambdas"
- Lesson 1636 — When @FunctionalInterface is Optional
- Compact and efficient
- optimized memory layout with no wasted space
- Lesson 1244 — Immutable Factory Methods: List.of, Set.of, Map.of
- Compact memory
- Only the exact number of slots needed
- Lesson 603 — EnumMap Performance: Array-Based Implementation
- Comparator
- comes in—it's an object that defines custom comparison logic.
- Lesson 269 — Arrays.sort with a ComparatorLesson 1183 — What Is a PriorityQueue?Lesson 1185 — Creating a PriorityQueue with a Custom ComparatorLesson 1220 — Sorting with Natural Order vs Comparator
- Comparator complexity
- A complex `compare()` method (one that does expensive computations) gets called O(n log n) times.
- Lesson 1364 — Sorting Performance Considerations
- Comparator factory methods
- are static methods that generate `Comparator` instances for common patterns.
- Lesson 1337 — Introduction to Comparator Factory Methods
- Comparing pairs
- Lesson 1647 — BiPredicate for Two-Argument Conditions
- Comparing two values
- Lesson 1679 — BiPredicate<T, U>: Two-Argument Boolean Tests
- compatibility
- with millions of lines of existing bytecode.
- Lesson 966 — Reified Generics in Other Languages: What Java LacksLesson 2539 — Automatic Modules Export All Packages
- compatible
- with the declared return type.
- Lesson 202 — Return Type Compatibility and CastingLesson 792 — Overriding Methods and Exception CompatibilityLesson 1511 — The Combiner Function in Parallel StreamsLesson 1739 — Method Reference Type InferenceLesson 2126 — Compatible vs Incompatible Class ChangesLesson 2130 — Best Practices for serialVersionUID ManagementLesson 2164 — Versioning Problems and Class Evolution
- Compilation Error
- If ambiguity can't be resolved, the compiler rejects the code with an error message about ambiguous method calls.
- Lesson 1732 — Ambiguity and Overload Resolution
- compile-time
- .
- Lesson 463 — Static vs Dynamic BindingLesson 804 — Introduction to Checked ExceptionsLesson 902 — Type Safety: Compile-Time vs RuntimeLesson 2491 — opens vs exports: Key Differences
- Compile-time checking
- Typos become compile errors instead of runtime surprises.
- Lesson 578 — What Are Enums and Why They Matter
- Compile-time declaration, runtime binding
- You declare the interface you need, but implementations are discovered dynamically
- Lesson 2500 — The 'uses' Directive in module-info.java
- Compile-time processing
- Happens while `javac` compiles your code (before any `.
- Lesson 2453 — Compile-Time vs Runtime Annotation Processing
- Compile-time safety
- The compiler will immediately flag an error if you accidentally add a second abstract method, breaking lambda compatibility
- Lesson 1634 — Using @FunctionalInterface on Custom InterfacesLesson 1637 — Error Messages When Violating the ContractLesson 1992 — StandardCharsets for Common EncodingsLesson 2428 — Enum- Valued Elements for Controlled Options
- Compile-time verification
- where the annotation's job is done once the compiler validates something
- Lesson 2434 — RetentionPolicy.SOURCE Explained
- Compiler enforcement
- Try-with-resources only accepts `AutoCloseable` types, catching errors at compile time
- Lesson 829 — Why AutoCloseable Matters
- Compiler error
- Lesson 1637 — Error Messages When Violating the Contract
- Compiler optimizations
- The compiler may reorder operations or cache values in registers
- Lesson 2680 — The Visibility Problem: Why volatile Exists
- CompletableFuture's `thenApply()`
- transforms a single asynchronous value in a pipeline:
- Lesson 2805 — thenApply vs map in Stream API
- Complete control
- You write every byte
- Lesson 2157 — Externalizable vs Serializable: Trade-offs and Decision Guide
- Completion trigger
- The returned future completes when all input futures complete (successfully or exceptionally)
- Lesson 2854 — CompletableFuture.allOf: Waiting for All Tasks
- Complex classpaths
- Modern applications have hundreds of libraries, increasing gadget chain possibilities
- Lesson 2158 — Serialization as an Attack Vector
- Complex comparisons
- When comparing objects with expensive comparison logic
- Lesson 1362 — Parallel Sorting with parallelSort()
- Complex expressions
- where contextual information is too distant
- Lesson 1731 — Target Type from Cast Expressions
- Complex generic hierarchies
- Lesson 1715 — Inference Limitations and Ambiguity
- Complex Generic Types
- If the inferred type isn't immediately obvious from context, explicit types document your intent.
- Lesson 1717 — Type Inference Benefits and Readability
- Composability
- Build complex rules from simple ones using `and()`, `or()`, `negate()`
- Lesson 1645 — Predicates for Validation and Business Rules
- Composable
- Each intermediate operation returns a new stream, enabling chaining
- Lesson 1480 — Understanding the Pipeline Pattern
- Compose multiple pipelines
- Combine this stage with others using methods like `allOf` or `anyOf`
- Lesson 2810 — Return Types: CompletableFuture<Void> for Both Methods
- Composition over inheritance
- When you implement `Runnable`, you're defining *what work should be done*—a task.
- Lesson 2569 — Thread vs Runnable: Design Trade-offsLesson 2572 — Creating a Thread with Runnable
- Compound assignment operators
- (`+=`, `-=`, `*=`, `/=`, `%=`) include a **built-in implicit cast** back to the type of the left operand.
- Lesson 84 — Compound Assignment Operators and Implicit CastingLesson 129 — Assignment Operators: =, +=, -=, *=, /=, %=
- Compound conditions
- Lesson 157 — Writing Effective while Loop Conditions
- Comprehensive validation
- Running multiple independent validation checks where all must pass
- Lesson 2767 — Use Cases: invokeAll vs invokeAny
- computationally expensive
- (complex calculations per element)
- Lesson 1385 — parallelStream() for Parallel ProcessingLesson 2821 — thenComposeAsync: Controlling Execution Threads
- Conciseness
- `count++` is shorter and clearer than `count = count + 1`
- Lesson 96 — Increment and Decrement Operators: ++ and --Lesson 1266 — Collections.addAll: Bulk Addition with Varargs
- Concurrent applications
- where multiple threads access the same file
- Lesson 2052 — Atomic Writes and File Creation Guarantees
- Concurrent collections
- High-contention scenarios, frequent reads/writes from many threads, performance-critical applications
- Lesson 986 — Synchronized Collections vs Concurrent CollectionsLesson 1252 — Synchronized Wrappers vs Concurrent CollectionsLesson 1305 — What Is Fail-Safe Behavior?
- ConcurrentHashMap
- uses lock striping: it divides the map into segments, allowing multiple threads to operate on different segments simultaneously.
- Lesson 1166 — When to Use ConcurrentHashMap vs Synchronized HashMapLesson 1577 — Custom Map Types with groupingBy Supplier
- ConcurrentModificationException
- Iterators detect mid-operation changes
- Lesson 1247 — Why Collections Need Synchronization
- condition
- A boolean expression (like `x > 10` or `isReady`)
- Lesson 126 — The Ternary Operator: Syntax and Basic UsageLesson 156 — The while Loop: Basic Syntax and Execution FlowLesson 251 — Iterating Arrays in Reverse Order
- Condition check
- – Tests whether to enter/continue the loop
- Lesson 166 — Executing for Loops: Step-by-Step Evaluation Order
- Conditional Logic
- You can conditionally add filters based on runtime conditions, building the pipeline dynamically.
- Lesson 1481 — Composing Multiple filter OperationsLesson 2579 — Thread.currentThread() for Self- ReferenceLesson 2625 — Checking Daemon Status
- Conditional traversal
- skip directories based on runtime logic
- Lesson 2089 — Files.walkFileTree for Complex Traversals
- Configuration and Constants
- Lesson 1246 — When to Use Unmodifiable Collections
- Configuration files
- that other processes read
- Lesson 2052 — Atomic Writes and File Creation GuaranteesLesson 2324 — Using Class.forName() for Dynamic Loading
- Configure queue sizes
- Control memory usage and backpressure
- Lesson 2866 — Why Custom Executors Matter: Isolation and Resource Control
- Connection failures
- The database server is unreachable, credentials are wrong, or the database doesn't exist
- Lesson 806 — SQLException: Database Access Errors
- Connection pool depletion
- Database connections remain "borrowed" but idle, preventing other parts of your application from accessing the database.
- Lesson 848 — The Problem of Resource Leaks
- Consecutive delimiters
- Lesson 2209 — Handling Empty Strings and Edge Cases in split()
- Consider alternatives
- JSON, Protocol Buffers, or custom formats give you more control and are generally safer than native serialization.
- Lesson 2166 — Best Practices for Safe Serialization
- Consider data characteristics
- If your collection is already mostly sorted, Timsort shines.
- Lesson 1364 — Sorting Performance Considerations
- Consider general handling when
- Lesson 764 — Granular vs General Exception Handling
- Consider locale implications
- Numbers formatted with `String.
- Lesson 2233 — Common Formatting Patterns and Pitfalls
- Consider the "final" keyword
- Mark methods `final` when subclasses shouldn't override them, even if they're `public` or `protected`.
- Lesson 721 — Access Control Strategy in Inheritance Hierarchies
- Consider visibility carefully
- make nested classes `private` when possible
- Lesson 621 — Common Use Cases and Best Practices
- Consistency
- All subclasses use the same implementation
- Lesson 481 — Concrete Methods in Abstract ClassesLesson 967 — The Collections Framework: Purpose and Design
- Consistency hashCode
- Equal objects have equal hash codes: `p1.
- Lesson 1093 — Testing Your equals and hashCode Implementations
- Consistent
- Lesson 289 — Overriding equals: The Contract and RulesLesson 542 — Overriding equals: The Five RequirementsLesson 1136 — Consistent Ordering and equals Contract
- Consistent behavior
- Iteration order (or lack thereof) matches the underlying hash table
- Lesson 1053 — HashSet Iterator: Iterating HashMap Keys
- consistent with equals
- .
- Lesson 1314 — Consistent with equalsLesson 1317 — Comparing Primitive Wrapper Classes
- Consistent with mathematical convention
- – the sum of an empty set is the additive identity (zero)
- Lesson 1594 — Handling Empty Streams with Summing and Averaging Collectors
- Constant memory footprint
- Only one line exists in memory at any moment
- Lesson 2014 — Processing Large Files with readLine
- Constant values
- – Listed in uppercase by convention, separated by commas
- Lesson 579 — Basic Enum Declaration Syntax
- Constant-Time Operations
- HashSet provides O(1) average-time complexity for:
- Lesson 993 — HashSet: Unique Elements with Hashing
- constants
- their values are locked:
- Lesson 70 — The final Keyword for VariablesLesson 366 — Common Use Cases for static Fields: Constants and CountersLesson 377 — Importing Static Methods and FieldsLesson 594 — Static Fields and Methods in Enums
- Constraint violations
- Inserting duplicate keys or violating foreign key rules
- Lesson 806 — SQLException: Database Access Errors
- constructor
- is a special method that runs automatically whenever you create a new object using the `new` keyword.
- Lesson 310 — Constructors: Special Methods for Object CreationLesson 413 — Common Pitfalls with super in ConstructorsLesson 638 — Local Classes vs Anonymous Classes
- Constructor body
- (the code inside the constructor you called)
- Lesson 354 — Complete Initialization Sequence: Fields, Blocks, Constructor
- Constructor execution
- The constructor runs, initializing the object's fields
- Lesson 313 — Creating Objects: Using new with Constructors
- Constructor initialization
- is best when:
- Lesson 349 — Field Initialization: Declaration vs Constructor
- Constructor logic
- You need initialization code (though lambdas can't have constructors anyway)
- Lesson 649 — When to Prefer Lambdas Over Anonymous Classes
- Constructors
- `this` refers to the object being created
- Lesson 316 — What is this? The Implicit Object ReferenceLesson 329 — public: Universal AccessibilityLesson 513 — Default Methods and Abstract Classes
- Constructors are necessary
- You need to initialize common state when objects are created
- Lesson 532 — Decision Criteria: A Practical Checklist
- consumed
- and cannot be reused.
- Lesson 1393 — Understanding the Two Categories of Stream OperationsLesson 1396 — Streams Are Single- Use: Terminal Operations Consume Them
- consumer
- (you're putting T items *into* it)
- Lesson 933 — Lower Bounded Wildcards: <? super T> SyntaxLesson 936 — Comparing extends vs super WildcardsLesson 941 — Consumers: When to Use '? super T'Lesson 944 — Real-World Example: Collections.copy and PECSLesson 948 — Practice: Refactoring Code to Apply PECSLesson 1629 — Common Functional Interfaces in java.util.function
- Consumer Super
- If a collection is *consuming* values you provide (you're putting items *in*), use `<?
- Lesson 939 — The PECS Principle: Producer Extends, Consumer Super
- container
- like `StringBuilder`
- Lesson 1512 — reduce vs collect: When to Use WhichLesson 1617 — Accumulator: Adding Elements to the Container
- Container deployments
- (smaller Docker images)
- Lesson 2552 — Comparing jlink Images to Traditional Deployments
- contains
- another as a component.
- Lesson 434 — is-a vs has-a: Composition vs InheritanceLesson 988 — Performance Characteristics Summary: Big-O Complexities
- Contains checks fail
- You add an object, then immediately call `contains()` with an equal object, and it returns `false`.
- Lesson 558 — HashSet Breakage: The Same Root Cause
- Content extraction
- Filter lines matching specific criteria
- Lesson 2224 — Combining lines with Stream Operations
- Context
- Add a meaningful message while keeping technical details
- Lesson 769 — Wrapping Exceptions: throw new Exception(cause)Lesson 1734 — Poly Expressions and Context Sensitivity
- Context Objects
- Instead of `ThreadLocal`, pass a context object through your call chain.
- Lesson 2641 — ThreadLocal Alternatives and When to Avoid It
- Continues until
- either a handler is found or the stack is exhausted
- Lesson 751 — The Search for a Handler
- contract
- a set of five rules—that your `equals` method must follow.
- Lesson 289 — Overriding equals: The Contract and RulesLesson 528 — Evolution and Backward Compatibility ConcernsLesson 695 — public Classes and One Public Class Per File RuleLesson 705 — Public Members: Universal VisibilityLesson 829 — Why AutoCloseable MattersLesson 2468 — Module Descriptors and Accessibility Rules
- Control
- Enforce specific thread counts or queueing behavior
- Lesson 2790 — Providing a Custom Executor to supplyAsync
- Control access
- Decide who can read or write each field
- Lesson 723 — Prefer private Fields with Controlled Public Methods
- Control resource allocation
- Dedicate a specific number of threads to side-effect operations
- Lesson 2791 — Providing a Custom Executor to runAsync
- Control thread count
- Prevent resource exhaustion by capping threads for specific workloads
- Lesson 2866 — Why Custom Executors Matter: Isolation and Resource Control
- Control your API surface
- keep implementation packages hidden from general consumers
- Lesson 2483 — Qualified exports: Restricting Access to Specific Modules
- Convention
- All Java developers recognize this syntax instantly
- Lesson 96 — Increment and Decrement Operators: ++ and --
- Conversion
- `d` (integer), `f` (floating-point), `e` (scientific notation)
- Lesson 2228 — Formatting Numbers with Precision
- Conversion or transformation
- operations that work across types
- Lesson 870 — Generic Static Methods: Utility Method Patterns
- Convert to bucket index
- `HashMap` takes that hash code and performs a calculation (typically involving modulo arithmetic with the array size) to convert it into a valid array index.
- Lesson 554 — How HashMap Uses hashCode for Bucket Selection
- Convert types
- Transform primitives, Strings, and nested objects into the target format
- Lesson 2389 — Serialization and Object Persistence
- Converting to status objects
- Lesson 2849 — Type Transformation in handle
- Converting to String
- Lesson 1430 — Mapping to Different Types
- cooperative mechanism
- for thread coordination.
- Lesson 2593 — InterruptedException: A Checked ExceptionLesson 2599 — What Is Thread Interruption?
- Coordinating with other I/O
- When writing to logs or synchronizing with external systems
- Lesson 1985 — flush: Forcing Buffer Contents to Disk
- Coordinating with other processes
- If another program is reading the file you're writing, flushing ensures they see your latest updates.
- Lesson 1957 — flush() and When to Use It
- copy
- of each element's value.
- Lesson 172 — Enhanced for Loop Limitations: No Index or ModificationLesson 200 — Primitive Parameters: Immutability in Method CallsLesson 1008 — System.arraycopy: The Reallocation Mechanism
- Copy all existing elements
- (via `System.
- Lesson 1013 — Triggering a Resize: When Capacity Is Exhausted
- Correct alternatives
- Lesson 1711 — Mixing Explicit and Inferred Types (Not Allowed)
- Correct pattern
- Lesson 890 — When Raw Types Are Unavoidable
- Correctness
- Non-ASCII characters (like emoji, accented letters, or other languages) are preserved
- Lesson 2044 — Character Encoding and Charset Parameters
- Cost
- One extra line, six keystrokes
- Lesson 423 — Best Practices: Always Use @OverrideLesson 1065 — Choosing Load Factor: Space vs Time Trade-offs
- Costly upstream operations
- If `map()` or `filter()` precedes `skip()`, those transformations run on discarded elements too
- Lesson 1469 — Performance Implications of skip
- Counting items per group
- Use `Collectors.
- Lesson 1571 — Downstream Collectors: Transforming Grouped Values
- Counting patterns
- Lesson 157 — Writing Effective while Loop Conditions
- Counts
- Abstract methods with no implementation in `Object`
- Lesson 1627 — Object Class Methods Don't Count
- Counts abstract methods
- (excluding `default` methods, `static` methods, and methods from `Object`)
- Lesson 1633 — Compiler Validation of Single Abstract Method
- covariant
- , which means if `Dog` is a subtype of `Animal`, then `Dog[]` is considered a subtype of `Animal[]`.
- Lesson 448 — Upcasting and Downcasting with ArraysLesson 897 — Cannot Create Generic ArraysLesson 1500 — Common Pitfalls with toArray(Object[]::new)
- covariant return types
- the return type can "vary" in one direction (downward in the inheritance tree, toward more specific types).
- Lesson 419 — Return Type Compatibility in OverridingLesson 470 — What Are Covariant Return Types?Lesson 472 — Covariant Returns with ClassesLesson 476 — Covariance vs Parameter Contravariance
- Covariant returns are safe
- because the caller expects at least the superclass return type.
- Lesson 476 — Covariance vs Parameter Contravariance
- CPU caching
- Each processor core caches frequently-used values locally
- Lesson 2680 — The Visibility Problem: Why volatile Exists
- CPU cycles
- spent boxing/unboxing
- Lesson 1388 — IntStream, LongStream, DoubleStream from Primitive Arrays
- CPU release
- The thread scheduler removes this thread from active consideration—it won't get CPU time until the sleep duration expires
- Lesson 2592 — What Happens During sleep: Thread State Changes
- CPU-bound, quick tasks
- that don't block.
- Lesson 2870 — Best Practices: When to Use Custom vs Default Executors
- CPU-intensive tasks
- → Pool matching CPU core count
- Lesson 2866 — Why Custom Executors Matter: Isolation and Resource Control
- CPU-intensive work
- with minimal I/O
- Lesson 2870 — Best Practices: When to Use Custom vs Default Executors
- Craft a stream
- declaring it contains a malicious class that implements `Serializable`
- Lesson 2161 — Type Confusion and Class Substitution
- Create
- a builder using `Stream.
- Lesson 1383 — Builder Pattern for Stream CreationLesson 2051 — OpenOption: Controlling Write Behavior
- Create a new array
- with double the capacity (old capacity × 2)
- Lesson 1126 — The Rehashing Process: Doubling Capacity
- Create a new node
- containing your data, with `prev` set to `null` and `next` pointing to the current head
- Lesson 1022 — Adding Elements to the BeginningLesson 1023 — Adding Elements to the End
- Create a tracking list
- of all temporary workarounds
- Lesson 2530 — Using --add-exports and --add-opens as Temporary Workarounds
- Create multiple specialized versions
- from a single generic class definition
- Lesson 858 — Instantiating Generic Classes with Type Arguments
- Create on demand
- If all threads are busy, a **new thread is created** to handle the task
- Lesson 2723 — newCachedThreadPool: Elastic Thread Pool for Short Tasks
- Create the exception object
- – This includes allocating memory like any other object
- Lesson 755 — Performance Impact of Unwinding
- Creating a FileReader
- Lesson 1968 — FileReader: Reading Text Files Character by Character
- Creating formatted lists
- Lesson 1562 — joining(delimiter, prefix, suffix): Full Control
- Creating indentation
- Lesson 2219 — The repeat Method: Duplicating Strings
- Creating JSON arrays
- Lesson 1562 — joining(delimiter, prefix, suffix): Full Control
- Credit card numbers
- `long` (16 digits exceed `int` range)
- Lesson 36 — Choosing the Right Integer Type for Your Data
- Critical
- If your `String` or enum variable is `null`, the `switch` will throw a `NullPointerException` at runtime.
- Lesson 148 — Switch with String and Enum TypesLesson 826 — Exceptions in close()Lesson 2101 — Handling Watch Service in a Monitoring LoopLesson 2144 — Reading Additional Data in readObject
- Critical business logic
- → Dedicated pool with guaranteed resources
- Lesson 2866 — Why Custom Executors Matter: Isolation and Resource Control
- Critical checkpoints
- When writing log files, you might want to flush after every critical error message so the information is preserved even if your program crashes immediately after.
- Lesson 1957 — flush() and When to Use It
- Critical data checkpoints
- After writing important data that must reach disk immediately (before continuing program logic)
- Lesson 1938 — close vs flush: Automatic Flushing on Close
- Critical details
- Lesson 687 — Executable JARs and the Main-Class Attribute
- Critical I/O Operations
- Lesson 2624 — Daemon Thread Limitations and Risks
- Critical logic
- Methods involved in security, mathematical calculations, or core algorithms that must remain consistent
- Lesson 424 — The final Keyword on Methods
- Critical rule
- `super()` must be the **first statement** in your subclass constructor, just like `this()`.
- Lesson 405 — The super() Constructor CallLesson 1226 — Sorting and Searching with Reverse Order
- Cross-language compatibility
- Protocol Buffers, JSON, and XML work with Python, JavaScript, Go, etc.
- Lesson 2165 — Alternatives to Java Serialization
- Cross-platform communication
- Need to talk to Python, JavaScript, or other languages?
- Lesson 2111 — When to Use and Avoid Serialization
- Cross-platform compatibility
- Some operating systems treat file names as case-insensitive (like Windows), which could cause problems if packages differ only by case.
- Lesson 680 — Package Name Case Conventions: All Lowercase
- Crucially, `isDone()` returns immediately
- it never blocks your thread.
- Lesson 2743 — isDone(): Checking Task Completion Non-Blockingly
- CSV/Delimited Data
- Lesson 2272 — Practical Use Cases: Parsing Structured Text
- Curly braces `{}`
- = the cabinet's walls that hold everything together
- Lesson 9 — Anatomy of a Java Source File
- Current task state
- Is it still running?
- Lesson 2739 — What is a Future? Asynchronous Computation Results
- Custom collection implementations
- Where certain operations make no sense
- Lesson 802 — UnsupportedOperationException in Collections
- Custom collections
- Lesson 1518 — Collectors.toCollection() for Specific Collection TypesLesson 1585 — Collecting to Different Data Structures per Partition
- Custom comparator
- Your own sorting logic passed at creation
- Lesson 974 — SortedSet and SortedMap: Ordered CollectionsLesson 1219 — Collections.sort for List Ordering
- Custom data structures
- require specialized accumulation (like your immutable collection from the previous lesson)
- Lesson 1623 — When to Write Custom Collectors vs Compose Existing Ones
- Custom evolution
- Handle versioning your way
- Lesson 2157 — Externalizable vs Serializable: Trade-offs and Decision Guide
- Custom implementations
- Some specialized collection classes simply don't support removal for design reasons.
- Lesson 1281 — Why remove() Is Optional and May Throw UnsupportedOperationException
- Custom initial capacity
- helps when you know roughly how many elements you'll store.
- Lesson 1064 — Custom Initial Capacity and Load Factor
- Custom ordering
- You provide a `Comparator` at TreeMap creation
- Lesson 1135 — Key Requirements: Comparable or Comparator
- Custom thread priorities
- (though rarely needed)
- Lesson 2728 — Thread Naming and Daemon Status in Factory Methods
- Cycling through ranges
- `index % arrayLength` wraps values
- Lesson 88 — The Modulus Operator: Finding Remainders
D
- daemon thread
- is a low-priority background thread that provides services to user threads.
- Lesson 2618 — What Are Daemon Threads?Lesson 2619 — User Threads vs Daemon Threads
- Daemon threads
- are the background staff (janitors, HVAC systems).
- Lesson 2619 — User Threads vs Daemon ThreadsLesson 2728 — Thread Naming and Daemon Status in Factory Methods
- Dagger
- uses annotations like `@Inject`, `@Component`, and `@Module` to generate dependency injection code.
- Lesson 2459 — Common Use Cases: Lombok, AutoValue, and Dagger
- dangerous
- because Java gives no warning.
- Lesson 33 — Integer Overflow: What Happens at the LimitsLesson 2362 — Breaking Encapsulation: Accessing Private Fields
- Data aggregation
- Fetching user data from multiple microservices where each service provides different information (profile, orders, preferences)
- Lesson 2767 — Use Cases: invokeAll vs invokeAny
- Data cleaning
- Remove comments or blank lines from configuration files
- Lesson 2224 — Combining lines with Stream Operations
- Data corruption
- You might set fields to invalid values the class never expected
- Lesson 2360 — Performance and Security Implications of Field Access
- Data integrity
- where partial writes would cause corruption
- Lesson 2052 — Atomic Writes and File Creation Guarantees
- Data loss
- if buffered writes never flush
- Lesson 1911 — The close() Method and Stream LifecycleLesson 1938 — close vs flush: Automatic Flushing on Close
- Database connections
- Return connections to the pool or close them entirely.
- Lesson 734 — Common finally Use Cases: Resource CleanupLesson 2136 — Use Case: Non-Serializable References
- Dates
- Precise format like "YYYY-MM-DD"
- Lesson 2260 — When to Use matches(): Input Validation and Format Checking
- Deadlines
- "Submit by December 31st" refers to the calendar date
- Lesson 1836 — LocalDate: Representing Dates Without Time
- Deadlock
- Thread A is waiting for Thread A to release the lock that Thread A holds
- Lesson 2677 — Why Non-Reentrant Locks Would DeadlockLesson 2690 — What Is Deadlock?Lesson 2701 — Classic Livelock Example: The Hallway ProblemLesson 2703 — Detecting Livelock vs DeadlockLesson 2705 — What Is Starvation?
- Debugging
- Log the actual types of objects when tracking down polymorphism issues
- Lesson 571 — The getClass Method: Runtime Type InformationLesson 769 — Wrapping Exceptions: throw new Exception(cause)Lesson 1151 — When to Use LinkedHashMap vs HashMapLesson 1455 — What is peek and Why It ExistsLesson 1461 — Side Effects in peek: When It's AcceptableLesson 1614 — When to Use teeing vs Separate CollectorsLesson 2044 — Character Encoding and Charset ParametersLesson 2579 — Thread.currentThread() for Self-Reference (+1 more)
- Debugging complexity
- If you exclude `jdk.
- Lesson 2552 — Comparing jlink Images to Traditional Deployments
- decimal
- (base 10): `42`, `255`, `1000`.
- Lesson 35 — Binary, Octal, and Hexadecimal Integer LiteralsLesson 56 — Integer Literals: Decimal, Hexadecimal, Octal, and Binary
- Declaration
- means you're announcing that a variable exists and what type of data it will hold.
- Lesson 243 — Array Declaration vs InstantiationLesson 825 — Implementing AutoCloseable
- Declaration initialization
- is best when:
- Lesson 349 — Field Initialization: Declaration vs Constructor
- Declarative
- You describe the transformation steps, not how to loop and mutate data
- Lesson 1480 — Understanding the Pipeline Pattern
- Declare explicit parameter types
- in the lambda itself
- Lesson 1715 — Inference Limitations and Ambiguity
- Declare it
- in your method signature with `throws InterruptedException`
- Lesson 2593 — InterruptedException: A Checked Exception
- Declare the field
- as you would in any class (usually `private final`)
- Lesson 587 — Declaring Fields in Enums
- Declared it
- in your method signature using `throws`
- Lesson 787 — Compile-Time Enforcement of Checked Exceptions
- Declaring
- a variable means telling Java "I need a box to store an integer, and I'm going to call it this name.
- Lesson 27 — Declaring and Initializing int Variables
- Declaring a MODULE annotation
- Lesson 2450 — ElementType.PACKAGE and MODULE
- Declaring a PACKAGE annotation
- Lesson 2450 — ElementType.PACKAGE and MODULE
- Declaring fewer exceptions
- from the superclass's list
- Lesson 421 — Checked Exceptions in Overriding Methods
- Declaring no exceptions
- (even if the superclass method declares some)
- Lesson 421 — Checked Exceptions in Overriding Methods
- Declaring the same exception
- Lesson 421 — Checked Exceptions in Overriding Methods
- Decoupling
- Consumer modules don't need compile-time dependencies on providers
- Lesson 2499 — The java.util.ServiceLoader ClassLesson 2713 — Task Queues: Buffering Work for Thread Pools
- Dedicated lock
- Production code, public APIs, libraries, or whenever external synchronization might occur
- Lesson 2664 — Synchronized on this vs Dedicated Lock Objects
- Dedicated threads
- for critical tasks to avoid contention with other operations
- Lesson 2790 — Providing a Custom Executor to supplyAsync
- Deduplicated identifiers
- in data processing where the same values repeat often
- Lesson 2184 — Common Use Cases and Anti-patterns
- Deep cloning
- Creating exact copies of complex object graphs is straightforward with serialization (serialize then deserialize).
- Lesson 2111 — When to Use and Avoid Serialization
- deep reflection
- access to:
- Lesson 2491 — opens vs exports: Key DifferencesLesson 2533 — Dealing with Reflection-Heavy Frameworks
- default
- (package-private, meaning no modifier at all).
- Lesson 694 — Class-Level Access Modifiers OverviewLesson 700 — Package-Private Members: Default Package VisibilityLesson 816 — Constructors: Message, Cause, and BothLesson 1626 — Default and Static Methods Are AllowedLesson 2437 — Use Cases for CLASS Retention
- default access
- , meaning it's only visible to other classes **within the same package**.
- Lesson 694 — Class-Level Access Modifiers OverviewLesson 696 — Package-Private Classes (Default Access)
- Default choice
- Use `int` for most general-purpose counting and calculations.
- Lesson 36 — Choosing the Right Integer Type for Your DataLesson 42 — Precision and Range of float vs doubleLesson 1045 — Use Case: When to Choose ArrayListLesson 2186 — StringBuilder: The Non- Synchronized Choice
- Default methods
- with unique names are inherited seamlessly
- Lesson 502 — Combining Abstract and Default Methods from Multiple InterfacesLesson 503 — Static Methods Across Multiple InterfacesLesson 518 — Static Methods vs Default Methods: Key DifferencesLesson 521 — Private Instance Methods in InterfacesLesson 1642 — Combining Predicates with and(), or(), and negate()
- Default to `StringBuilder`
- In the vast majority of scenarios, `StringBuilder` is the right choice.
- Lesson 2194 — When to Use StringBuilder vs StringBuffer
- default value
- based on its type.
- Lesson 307 — Field Initialization: Default ValuesLesson 350 — Default Values for Uninitialized Fields
- Default value providers
- Supplying fresh instances
- Lesson 1747 — Constructor References with No Arguments
- default values
- but these defaults differ dramatically between primitives and references.
- Lesson 280 — Default Values: Primitives vs ReferencesLesson 1665 — What is Supplier<T> and When to Use ItLesson 2127 — Adding Fields to a Serializable ClassLesson 2133 — Default Values After Deserialization
- Defensive copying
- creates a brand-new, independent collection containing copies of the original elements.
- Lesson 1245 — Defensive Copying vs Unmodifiable ViewsLesson 2172 — Defensive Copying Is Unnecessary
- Defensive pattern with setAccessible
- Lesson 2359 — IllegalAccessException and Error Handling
- Defer work
- Store items and handle the most recent one first (like function call stacks)
- Lesson 1218 — Stack vs Queue Trade-offs in Problem Solving
- Define a service interface
- in one module (e.
- Lesson 2498 — The Service Provider Interface (SPI) Pattern
- Define the `compareTo` method
- with your comparison logic
- Lesson 1311 — Implementing Comparable in a Custom Class
- Degraded performance
- The application slows down as resources pile up.
- Lesson 848 — The Problem of Resource LeaksLesson 1112 — Performance Characteristics: O(1) Average Case
- Delegate
- to a preferred default while adding your own behavior
- Lesson 500 — Using super to Call Specific Default Method
- Deleting fields
- Old data contains fields the new class doesn't expect
- Lesson 2126 — Compatible vs Incompatible Class Changes
- Demonstration and learning
- When teaching concurrency, `Thread.
- Lesson 2590 — The Purpose of Thread.sleep
- Dependency injection
- Spring invokes setter methods or factory methods dynamically
- Lesson 2341 — Overview of Method.invoke and Its PurposeLesson 2370 — Why Create Instances ReflectivelyLesson 2387 — Practical Use Cases: Frameworks and Custom ProcessingLesson 2641 — ThreadLocal Alternatives and When to Avoid It
- Dependency Injection (Spring, CDI)
- Lesson 2439 — Use Cases for RUNTIME Retention
- Dependency injection frameworks
- (Spring, CDI) require constructor and field access
- Lesson 2492 — Unconditional opens: Opening Packages to All Modules
- Dependency Inversion Principle
- the sorting algorithms depend on the `Comparable` abstraction, not on specific class details.
- Lesson 1315 — Sorting with Collections.sort and Arrays.sort
- deque
- (double-ended queue)—efficient at both ends.
- Lesson 1021 — Head and Tail ReferencesLesson 1193 — What Is a Deque? Double-Ended Queue Explained
- Dereferencing null
- Lesson 285 — NullPointerException: Causes and Prevention
- Derived fields
- Recalculate values based on other fields (e.
- Lesson 2138 — Restoring transient Fields on Deserialization
- Design intent
- Some classes represent complete, immutable concepts that shouldn't be specialized.
- Lesson 427 — The final Keyword on Classes
- Design principle
- Refactor your code so each operation needs only one lock.
- Lesson 2699 — Avoiding Nested Locks and Minimizing Lock Scope
- Detect failure
- if the lock isn't available in time
- Lesson 2698 — Timeouts and tryLock: Breaking Potential Deadlocks
- Detection difficulty
- With two threads, you might notice the hang quickly.
- Lesson 2694 — Deadlock with Multiple Threads and Resources
- Determine the minimum
- The smallest indentation among all lines (including the closing delimiter)
- Lesson 2237 — Indentation Removal Algorithm
- deterministic
- cleanup happens exactly when the try block ends, not at some unknown future time.
- Lesson 576 — Modern Alternatives to finalizeLesson 1542 — findFirst: Deterministic Element Selection
- Deterministic Output
- When running tests or generating reports, you want consistent, predictable results.
- Lesson 1081 — Use Cases for Insertion Order
- Devirtualization
- If the JIT determines only one implementation is ever used at a call site, it replaces dynamic dispatch with a direct call
- Lesson 468 — Performance Implications of Dynamic Dispatch
- diamond operator
- to eliminate this redundancy.
- Lesson 859 — Diamond Operator: Type Inference in ConstructorsLesson 875 — The Diamond Operator (<>)Lesson 901 — Creating ArrayList with Type ArgumentsLesson 905 — The Diamond Operator: Type Inference
- Different neighborhood
- Only blood relatives (subclasses) can visit
- Lesson 706 — Protected Members and Package Boundaries
- Different package
- Package-private members are invisible, period
- Lesson 704 — Package-Private (Default) Access Across Packages
- Different pool sizes
- optimized for your workload (CPU-bound vs I/O-bound)
- Lesson 2790 — Providing a Custom Executor to supplyAsync
- Different types
- Lesson 1647 — BiPredicate for Two-Argument Conditions
- Diminishing returns
- as buffer size increases?
- Lesson 1958 — Profiling I/O Performance: Identifying Bottlenecks
- Direct buffer operations
- Transfer data with less copying between user and kernel space
- Lesson 1955 — File Channel and Memory-Mapped I/O Preview
- Direct index calculation
- The hash code instantly tells you which bucket to check (math operation, not a search)
- Lesson 1112 — Performance Characteristics: O(1) Average Case
- Direct invocation
- Methods like `invokeExact()` and `invoke()` provide faster dispatch mechanisms than traditional reflection.
- Lesson 2403 — MethodHandles as a Faster Alternative
- Directories
- containing `.
- Lesson 689 — The Classpath: Finding Classes at RuntimeLesson 2518 — Running Modular Applications: -- module-path Flag
- Directories must be empty
- You cannot delete a directory containing files or subdirectories
- Lesson 2060 — Files.delete: Deleting Files and Directories
- discards
- elements from the beginning while the predicate is true.
- Lesson 1471 — What Are takeWhile and dropWhile?Lesson 2208 — Limit Parameter in split(): Controlling Array Size
- Discover fields
- Call `getDeclaredFields()` to find all properties
- Lesson 2389 — Serialization and Object Persistence
- Distributed computation
- Splitting a large dataset across workers, then combining all partial results
- Lesson 2767 — Use Cases: invokeAll vs invokeAny
- Distributed systems (same codebase)
- When sending objects between JVMs running identical code versions—like in RMI (Remote Method Invocation) or specific clustering scenarios—serialization provides a quick solution.
- Lesson 2111 — When to Use and Avoid Serialization
- Division (/)
- Divides the left value by the right.
- Lesson 86 — The Five Basic Arithmetic Operators: +, -, *, /, %
- do
- this action.
- Lesson 1699 — Lambda Expression Structure: Arrow NotationLesson 2697 — Lock Ordering: The Primary Prevention Strategy
- Do all elements match
- **Do none of the elements match?
- Lesson 1532 — Understanding Match Operations Overview
- Document assumptions
- Make time zone choices explicit in comments
- Lesson 1902 — Interoperating with Legacy APIs
- Document clearly
- If you're returning a synchronized collection from a method, document it so callers don't re-wrap it
- Lesson 1253 — Nested Synchronized Wrapper Anti-Pattern
- Document close() behavior clearly
- If your `close()` method can throw specific exceptions, document when and why, so callers can decide whether to check suppressed exceptions.
- Lesson 847 — Best Practices for Suppressed Exceptions
- Document each flag
- with a comment explaining why it's needed
- Lesson 2530 — Using --add-exports and --add-opens as Temporary Workarounds
- Document intended inheritance
- Use comments to clarify which methods subclasses should override and which they should just call.
- Lesson 721 — Access Control Strategy in Inheritance Hierarchies
- Document temporary workarounds
- Track which dependencies remain automatic
- Lesson 2543 — Migration Strategy: From Automatic to Explicit Modules
- Document Unusual Ordering
- Lesson 765 — Catch Order Best Practices
- Document your public API
- What's `public` is your contract with other developers
- Lesson 712 — Cross-Package Access Patterns and Best Practices
- Documentation
- It explicitly tells other developers (and your future self) that this interface is designed to work with lambdas
- Lesson 1634 — Using @FunctionalInterface on Custom Interfaces
- Documentation suffers
- The relationship between components isn't visible in the code structure
- Lesson 2396 — Maintaining Code with Reflection
- does not
- change or override Java's access control rules—visibility is still governed by access modifiers alone.
- Lesson 711 — Import Statements Do Not Grant AccessLesson 1864 — Period Arithmetic and Normalization
- Does NOT change modCount
- `get()`, `set()`, `contains()`, `size()` (these aren't structural changes)
- Lesson 1301 — The modCount Field in ArrayList
- Does NOT include
- private, protected, or package-private methods
- Lesson 2333 — Getting Methods with getMethods()
- doesn't
- give you:
- Lesson 172 — Enhanced for Loop Limitations: No Index or ModificationLesson 755 — Performance Impact of Unwinding
- Doesn't count
- `equals()`, `hashCode()`, `toString()`, `getClass()`, `notify()`, etc.
- Lesson 1627 — Object Class Methods Don't Count
- Domain
- `oracle.
- Lesson 679 — Package Naming Convention: Reverse Domain NamesLesson 2284 — URL and URI Matching
- Domain-specific errors need identification
- An `InsufficientFundsException` tells you more than a generic `IllegalStateException`
- Lesson 821 — Best Practices: Avoiding Exception Overuse
- Don't assume single-round processing
- your processor may run multiple times.
- Lesson 2460 — Debugging Annotation Processors
- Don't implement `Comparable` if
- Lesson 1318 — When Not to Use Comparable
- Don't use Optional for
- Lesson 1767 — Optional as a Return Type
- double the capacity
- of the old one.
- Lesson 1061 — The Rehashing Process: Creating a Larger ArrayLesson 1207 — Array Growth and Capacity Doubling
- Double-ended queue operations
- Adding/removing from both ends efficiently
- Lesson 980 — ArrayList vs LinkedList: Access Patterns Matter
- doubly-linked list
- running through all entries.
- Lesson 983 — LinkedHashSet and LinkedHashMap: Preserving Insertion OrderLesson 1077 — Insertion Order GuaranteeLesson 1142 — LinkedHashMap Overview: Ordering in MapsLesson 1143 — Insertion Order Mode
- Downcasting
- is the reverse operation: you explicitly cast a superclass reference back to a subclass type to regain access to those subclass-specific features.
- Lesson 443 — What is Downcasting?
- Download
- Visit the JDK provider's website (Oracle or Adoptium for OpenJDK) and download the Windows `.
- Lesson 4 — Installing the JDK on Your Operating System
- Download times
- for client applications
- Lesson 2552 — Comparing jlink Images to Traditional Deployments
- downstream collector
- as the second argument to `groupingBy()`.
- Lesson 1574 — Collecting to Different Collection Types per GroupLesson 1576 — Mapping Values Within GroupsLesson 1582 — partitioningBy with Downstream CollectorsLesson 1585 — Collecting to Different Data Structures per PartitionLesson 1587 — Counting Elements with Collectors.counting()Lesson 1593 — Using averagingInt to Calculate Group AveragesLesson 1599 — When to Use reducing vs Stream.reduceLesson 1604 — collectingAndThen: Post-Processing Collected Results
- downstream collectors
- come in.
- Lesson 1571 — Downstream Collectors: Transforming Grouped ValuesLesson 1600 — Downstream Collectors: Transforming Grouped Results
- DTO mapping
- , **factory methods**, and **collecting stream results**.
- Lesson 1753 — Common Patterns and Use Cases
- Dual functionality
- If you need both queue operations (offer, poll, peek) AND list operations (add at specific index, get by position) on the same data structure, `LinkedList` is your only option that implements both interfaces.
- Lesson 1180 — When to Use LinkedList as a Queue
- Duplicate detection
- Check if `frequency() > 1`
- Lesson 1264 — Collections.frequency: Counting Element Occurrences
- Duplicate elements appear
- The set can contain what *should be* duplicates because different hash codes send "equal" objects to different buckets.
- Lesson 558 — HashSet Breakage: The Same Root Cause
- Duplicates Allowed
- You can add the same element multiple times:
- Lesson 969 — List Interface: Ordered Collections with Duplicates
- Duration
- works with **time-based types** (those containing time components):
- Lesson 1865 — Adding Duration and Period to Temporal Objects
- Duration examples
- Lesson 1857 — Duration vs Period: Temporal Amounts in java.time
- During `sleep()` call
- Thread immediately transitions to `TIMED_WAITING` state
- Lesson 2592 — What Happens During sleep: Thread State Changes
- dynamic binding
- (also called runtime polymorphism): Java decides *which version* of an overridden method to call based on the actual object type at runtime.
- Lesson 422 — static Methods Cannot Be OverriddenLesson 463 — Static vs Dynamic Binding
- Dynamic instantiation
- Creating objects without compile-time knowledge of the type
- Lesson 2320 — What is the Class Object?
- Dynamic Object Creation
- Lesson 2370 — Why Create Instances Reflectively
E
- Early exit
- It immediately terminates the method, even if there's more code below
- Lesson 196 — The return Statement: Early Exit and Value Propagation
- Early return
- even if `try` or `catch` contains a `return` statement, `finally` executes first
- Lesson 733 — The finally Block: Guaranteed Execution
- Early termination
- Operations like `findFirst()` or `anyMatch()` stop as soon as they find a result
- Lesson 1406 — Why Laziness Matters for PerformanceLesson 2074 — DirectoryStream Interface OverviewLesson 2089 — Files.walkFileTree for Complex Traversals
- Eases debugging
- Smaller scope means fewer places where things can go wrong
- Lesson 193 — Best Practices for Variable Scope
- Easier maintenance
- Less custom code to break
- Lesson 2157 — Externalizable vs Serializable: Trade-offs and Decision Guide
- Easier reasoning
- the object's state at construction is its state forever
- Lesson 727 — Immutability and final: Defensive Access Control
- effectively final
- .
- Lesson 634 — Accessing Local Variables from Local ClassesLesson 635 — Effectively Final RequirementLesson 772 — Precise Rethrow (Java 7+): Improved Type SafetyLesson 832 — Pre-Initialized Resources (Java 9+)Lesson 1718 — What Is Variable Capture in Lambdas?Lesson 1719 — The Effectively Final RequirementLesson 1720 — What Makes a Variable Effectively Final?Lesson 1949 — Effectively Final Resources (Java 9+)
- Efficiency
- You avoid unnecessary computations.
- Lesson 140 — Short-Circuit Evaluation: Efficiency and Safety
- Efficient
- O(n log n) worst-case performance, but often faster in practice
- Lesson 1221 — Sorting Stability and Implementation DetailsLesson 1480 — Understanding the Pipeline Pattern
- Efficient with expensive sources
- If reading elements is costly (database queries, network calls), `limit()` prevents fetching more than necessary.
- Lesson 1414 — Intermediate Short-Circuiting: limit Operation
- either
- the `if` block executes **or** the `else` block executes, but never both.
- Lesson 135 — The else Clause: Handling the Alternative PathLesson 1642 — Combining Predicates with and(), or(), and negate()
- Elegant
- Works for any distance (positive or negative) after normalizing
- Lesson 1236 — Rotate Internals: Reversal Algorithm
- element
- within that row.
- Lesson 260 — Enhanced for Loop with 2D ArraysLesson 1028 — Memory Overhead of Nodes
- Element modification
- Not just remove elements—you can replace them or insert new ones at the current position.
- Lesson 1282 — The ListIterator Interface Overview
- Eliminate casting
- No need to cast objects when retrieving them
- Lesson 858 — Instantiating Generic Classes with Type Arguments
- Eliminate casts
- Because the compiler knows the type, you don't need manual casts when retrieving elements.
- Lesson 855 — What Are Generics and Why They Matter
- Eliminates creation overhead
- Threads are created once
- Lesson 2712 — Thread Pools: Reusing Threads for Efficiency
- Eliminates get() Risk
- Lesson 1792 — ifPresent vs isPresent+get: Why ifPresent Is Better
- Email Address Decomposition
- Lesson 2272 — Practical Use Cases: Parsing Structured Text
- Email addresses
- Must follow a complete email format
- Lesson 2260 — When to Use matches(): Input Validation and Format Checking
- Email validation
- Ensuring input looks like a complete email address
- Lesson 2256 — Using matches() for Full String Validation
- Emphasizing Origin
- Sometimes the package name adds important context.
- Lesson 678 — When to Use FQNs vs Import Statements
- Empty
- No entries yet exist here
- Lesson 1108 — put() Operation: Insertion ProcessLesson 1772 — The isEmpty() Method (Java 11+)
- Empty arrays
- Forgetting that a zero-length array has no valid indices at all
- Lesson 245 — ArrayIndexOutOfBoundsException and Bounds Checking
- Empty line
- → `readLine()` returns `""` (an empty `String` object)
- Lesson 2013 — Empty Lines and readLine Behavior
- Enable framework/library cooperation
- without polluting the public API
- Lesson 2483 — Qualified exports: Restricting Access to Specific Modules
- Enables chaining
- combine multiple comparison criteria fluently (you'll learn this soon)
- Lesson 1337 — Introduction to Comparator Factory Methods
- encapsulation
- the principle that a class should control its own data.
- Lesson 338 — The Purpose of Getters and SettersLesson 618 — Organizing Related Classes with Static Nested ClassesLesson 619 — Static Nested Classes vs Top-Level ClassesLesson 621 — Common Use Cases and Best PracticesLesson 699 — private Members: Encapsulation Within the ClassLesson 716 — Private Members Are Not InheritedLesson 2362 — Breaking Encapsulation: Accessing Private FieldsLesson 2517 — Module Path Introduction: A New Way to Organize Code
- Encapsulation boundaries
- where only the outer class and its inner helper can see certain implementation details
- Lesson 630 — Inner Classes and Encapsulation
- Encapsulation is preserved
- Implementation details stay hidden
- Lesson 523 — Visibility Rules: Private Methods Cannot Be Overridden
- Encoding-aware
- Automatically handles character encoding conversion
- Lesson 1959 — The Reader Hierarchy: Character-Based Input
- encounter order
- (when the source has order, like lists).
- Lesson 1366 — Stream<T> as a Sequence of ElementsLesson 1493 — Order Guarantees with forEachLesson 1544 — Encounter Order and Its Impact on find OperationsLesson 1546 — findFirst vs findAny in Parallel Streams
- end
- of a LinkedList, Java uses the `linkLast()` method internally.
- Lesson 1023 — Adding Elements to the EndLesson 1145 — Access Order Mode: The accessOrder ParameterLesson 1177 — Queue vs List Methods on LinkedListLesson 2189 — Common StringBuilder Methods: append and insertLesson 2213 — stripLeading() and stripTrailing(): Directional StrippingLesson 2823 — Combining thenCompose with thenApply and thenAccept
- End of file
- → `readLine()` returns `null` (no more data to read)
- Lesson 2013 — Empty Lines and readLine Behavior
- Enforces Functional Thinking
- Lesson 1792 — ifPresent vs isPresent+get: Why ifPresent Is Better
- enhanced for loop
- (also known as **for-each**) that lets you iterate over every element in an array without touching indices at all.
- Lesson 171 — The Enhanced for Loop (for-each): Syntax and PurposeLesson 906 — Generic Collection Methods: forEach and Enhanced forLesson 1296 — Enhanced For Loop vs Traditional For LoopLesson 1299 — forEach Method vs Enhanced For LoopLesson 1490 — forEach vs Enhanced for Loop
- entire
- input string match this pattern from beginning to end?
- Lesson 2247 — The matches() Method: Full String MatchLesson 2249 — The lookingAt() Method: Prefix MatchingLesson 2252 — Pattern.matches() Static Convenience Method
- Entry point gadget
- A class whose `readObject()` calls methods on other objects
- Lesson 2159 — Gadget Chains and Object Injection
- enum
- (enumeration) is a special Java type that defines a fixed set of named constants.
- Lesson 578 — What Are Enums and Why They MatterLesson 579 — Basic Enum Declaration Syntax
- Enum name
- – Follows standard naming conventions (capitalize first letter)
- Lesson 579 — Basic Enum Declaration Syntax
- EnumMap
- knows its keys are enums from a fixed, predefined set.
- Lesson 601 — Introduction to EnumMap: A Specialized Map for Enum Keys
- Enums
- Return the specific enum constant
- Lesson 2384 — Extracting Annotation Element ValuesLesson 2425 — Element Types: Primitives, Strings, and Classes
- Environment-specific
- thread references, database connections, file handles
- Lesson 2132 — Marking Fields as transient
- EOF detection
- Reading past the last object throws `EOFException`
- Lesson 2115 — Serializing Multiple Objects in Sequence
- equal to
- Are the values exactly the same?
- Lesson 104 — Relational Operators: ==, !=, <, >, <=, >=Lesson 1313 — Return Values: Negative, Zero, Positive
- Error 1: Forgetting exclusivity
- Lesson 2196 — Understanding substring Indices and Off-by-One Errors
- Error checking
- `errorRaised()` indicates if errors occurred in previous rounds
- Lesson 2457 — The RoundEnvironment and Processing Rounds
- Error handling
- If an exception occurs before `close()`, you risk losing buffered data
- Lesson 1938 — close vs flush: Automatic Flushing on CloseLesson 2089 — Files.walkFileTree for Complex TraversalsLesson 2748 — Practical Pattern: Submitting Multiple Tasks and Collecting Results
- Error-prone
- You might mistype the cast or variable name
- Lesson 452 — The Boilerplate Problem: Test-Cast-Use Pattern
- escape sequence
- is a backslash (`\`) followed by a special character code.
- Lesson 49 — Character Literals and Escape SequencesLesson 61 — String Literals and Escape Characters
- essential
- they stay in the final string.
- Lesson 2236 — Incidental vs Essential WhitespaceLesson 2237 — Indentation Removal Algorithm
- Event handling
- React to multiple events (network messages, timers, user actions) concurrently without blocking other parts of your application.
- Lesson 2560 — When to Use Threads in Java
- Event processors
- monitoring a queue until shutdown
- Lesson 169 — Omitting for Loop Components: Infinite Loops
- Event Scheduling
- Storing time slots where you need to find the next available slot after a given time (`ceiling()`) or the last slot before a deadline (`floor()`).
- Lesson 1101 — TreeSet as NavigableSet: Practical Applications
- Event simulation
- where events must be processed by timestamp rather than insertion order
- Lesson 1183 — What Is a PriorityQueue?
- Eventual failure
- Your application crashes or becomes unresponsive.
- Lesson 848 — The Problem of Resource Leaks
- Eventual release
- Only when all nested synchronized contexts complete does the lock become available
- Lesson 2674 — Lock Acquisition Count: Entry and Exit Tracking
- Eventually become false
- (preventing infinite loops)
- Lesson 157 — Writing Effective while Loop Conditions
- every element
- in order
- Lesson 175 — Choosing Between Traditional and Enhanced for LoopsLesson 1530 — Performance Characteristics of count, min, and maxLesson 1568 — Basic groupingBy Syntax and Classifier Functions
- Every nth item
- `counter % n == 0` triggers every n iterations
- Lesson 88 — The Modulus Operator: Finding Remainders
- Every single operation
- in Vector—`add()`, `get()`, `size()`—acquires and releases a lock.
- Lesson 1031 — Vector vs ArrayList: Key Differences
- Every single time
- you override a method, type `@Override` on the line above it.
- Lesson 423 — Best Practices: Always Use @OverrideLesson 1790 — Common Pitfalls with orElse Family Methods
- every time
- you create an object, and only after static initialization is complete.
- Lesson 375 — Order of Initialization: Static vs InstanceLesson 1454 — Performance Considerations: sorted vs Pre-Sorted CollectionsLesson 2367 — Performance Cost of setAccessible Calls
- exact same object
- .
- Lesson 286 — Reference Equality with ==: Comparing Memory AddressesLesson 768 — Rethrowing the Same Exception Instance
- exactly
- .
- Lesson 490 — Implementing Interface Methods: Overriding RulesLesson 583 — The valueOf(String) MethodLesson 2119 — writeObject() and readObject() Method SignaturesLesson 2372 — Constructor.newInstance(): Creating Objects
- exactly once
- , before anything else
- Lesson 166 — Executing for Loops: Step-by-Step Evaluation OrderLesson 370 — When Static Blocks Execute
- exactly one
- superclass—no more, no less.
- Lesson 394 — Single Inheritance in JavaLesson 2484 — Multiple Qualified exports for Fine-Grained Control
- exactly one abstract method
- .
- Lesson 1624 — Definition of a Functional InterfaceLesson 1630 — Creating Custom Functional Interfaces
- exactly one parameter
- , Java lets you omit the parentheses around that parameter.
- Lesson 1700 — Single Parameter Lambda: Parentheses OptionalLesson 1716 — Parentheses Rules for Single Parameters
- exactly the same signature
- (name, parameters, and return type), there's no conflict at all.
- Lesson 498 — Interface Method Name ConflictsLesson 964 — Cannot Overload Methods Differing Only by Type Parameters
- Examines each entry
- in the bucket (traversing linked lists or tree bins)
- Lesson 1128 — Recalculating Hash Indices After Resizing
- Example command
- Lesson 22 — javac vs java: The Compiler and Runtime Tools
- Example mental model
- Think of a hash table as a filing cabinet with random drawers—lightning-fast access, but no inherent organization.
- Lesson 982 — HashMap vs TreeMap: When Sorted Keys Are Worth the Cost
- Example of violation
- Imagine comparing `Person` objects where you return results based on random coin flips, or switching comparison criteria inconsistently.
- Lesson 1321 — Transitivity: If A > B and B > C, Then A > C
- Example pattern
- Lesson 2143 — Writing Additional Data in writeObject
- Example scenario
- A `Shape` class might have a `protected` method `calculateArea()` that all shape subclasses need to implement or call, but external code shouldn't invoke directly.
- Lesson 330 — protected: Inheritance and Package AccessLesson 348 — Default Constructor Provided by the CompilerLesson 525 — Abstract Classes: Is-A with Shared ImplementationLesson 803 — When to Use RuntimeException vs Checked ExceptionsLesson 994 — HashSet: When to Use ItLesson 1130 — Custom Load Factor: When and Why to Change ItLesson 1317 — Comparing Primitive Wrapper ClassesLesson 1318 — When Not to Use Comparable (+3 more)
- Example scenarios
- Handling thousands of brief I/O callbacks, processing sporadic user events, or managing websocket messages.
- Lesson 2725 — When to Use newCachedThreadPool vs newFixedThreadPool
- Example structure
- Lesson 825 — Implementing AutoCloseable
- Example type flow
- Lesson 1608 — The teeing Method Signature and Type Parameters
- Example with `Function`
- Lesson 1745 — Introduction to Constructor References
- Example with `Supplier`
- Lesson 1745 — Introduction to Constructor References
- Example with TreeMap
- (sorted alphabetically by first letter):
- Lesson 1577 — Custom Map Types with groupingBy Supplier
- exception handling
- to gracefully manage these failures.
- Lesson 729 — The try Block: Marking Code That May Throw ExceptionsLesson 823 — The close() Method ContractLesson 2825 — Understanding thenCombine: Combining Independent Futures
- Exception handling dilemma
- If both the main code and `close()` throw exceptions, which one do you report?
- Lesson 850 — The Classic finally Block Pattern
- Exception is caught
- code throws, jumps to matching `catch`, then runs `finally`
- Lesson 733 — The finally Block: Guaranteed Execution
- Exception is not caught
- code throws, no matching `catch` exists, but `finally` still runs before propagating the exception upward
- Lesson 733 — The finally Block: Guaranteed Execution
- Exception propagation
- If the original future fails, `thenApply` never executes
- Lesson 2797 — What thenApply Does: Synchronous Transformation
- Exception style
- If someone asks for a table when the list is full, the host loudly announces "We're full!
- Lesson 1171 — Exception-Throwing vs Returning-Special-Value Methods
- Exception swallowing
- Exceptions in `finalize()` are ignored silently
- Lesson 574 — The finalize Method: Legacy Cleanup Mechanism
- Exception type
- What kind of exception it catches (e.
- Lesson 730 — The catch Block: Handling Specific Exception Types
- Exception wrapping
- – packaging any constructor exceptions into `InvocationTargetException`
- Lesson 2378 — Performance and Security Considerations
- Exception Wrapping Issues
- It throws checked exceptions directly from constructors, rather than wrapping them in `InvocationTargetException`.
- Lesson 2374 — Using Class.newInstance() and Its Deprecation
- Exception-throwing
- "I *must* get $50 or I want the machine to shout at me!
- Lesson 1178 — Exception-Throwing vs Null-Returning Methods
- Exception-throwing methods
- (`add`, `remove`) are like demanding customers: "I MUST get a table now, or I'm complaining to the manager!
- Lesson 1168 — Queue Core Methods: add, offer, remove, pollLesson 1171 — Exception-Throwing vs Returning-Special-Value MethodsLesson 1178 — Exception-Throwing vs Null-Returning MethodsLesson 1205 — Removing Elements: removeFirst, removeLast, pollFirst, pollLast
- exceptions
- ) are problems that occur *while your program is executing*.
- Lesson 15 — Understanding Runtime ErrorsLesson 2119 — writeObject() and readObject() Method Signatures
- Exchange data
- across systems where the offset matters but zone rules don't
- Lesson 1867 — Introduction to OffsetDateTime
- Execution timeline
- Lesson 2693 — Visualizing the Circular Wait
- Execution triggers
- All those lazy intermediate operations you chained together finally run
- Lesson 1488 — Understanding forEach as a Terminal Operation
- Exhaustiveness
- means accounting for every possible value your variable might have.
- Lesson 146 — The default Case and Exhaustiveness
- Exits `methodC()`
- immediately, abandoning any remaining code in that method
- Lesson 750 — Exception-Driven Stack Unwinding
- Expensive computation
- `optional.
- Lesson 1784 — Choosing Between orElse and orElseGetLesson 1789 — Performance Comparison: orElse vs orElseGet
- explicit
- about parameter types by declaring them yourself: `(Integer x, Integer y) -> x + y`.
- Lesson 1706 — Parameter Type Declaration: Explicit TypesLesson 2475 — Platform Modules: Requiring JDK Modules
- explicit cast
- .
- Lesson 78 — Narrowing Conversions: Potential Data LossLesson 1731 — Target Type from Cast Expressions
- explicit casting
- you must tell Java you understand the risk of data loss:
- Lesson 202 — Return Type Compatibility and CastingLesson 1732 — Ambiguity and Overload Resolution
- Explicit mismatch
- Both versions declare `serialVersionUID`, but with different values
- Lesson 2125 — InvalidClassException: Version Mismatch Errors
- Explicit module
- You control visibility with `exports com.
- Lesson 2539 — Automatic Modules Export All Packages
- Explicit Override Required
- Lesson 511 — The Diamond Problem and Resolution Rules
- Explicit versioning
- Schema evolution is built-in and controlled
- Lesson 2165 — Alternatives to Java Serialization
- explicitly
- call `super()` with arguments to invoke a *specific* superclass constructor.
- Lesson 405 — The super() Constructor CallLesson 2468 — Module Descriptors and Accessibility Rules
- Explicitness
- Each command shows exactly which classpath it uses
- Lesson 691 — The CLASSPATH Environment Variable
- Exported packages
- (all `exports` declarations)
- Lesson 2510 — Inspecting Modular JAR Contents with jar --describe-module
- Exported packages remain exported
- via `exports` directives
- Lesson 2494 — Open Modules: Making All Packages Reflectively Accessible
- Exports everything
- All packages are implicitly exported
- Lesson 2515 — Modular JARs vs Non-Modular JARs at Runtime
- Exports everything to itself
- All packages in the unnamed module are accessible to other classpath code
- Lesson 2469 — Unnamed Modules and Compatibility
- Expose internals selectively
- for testing or tight integration without making them fully public
- Lesson 2483 — Qualified exports: Restricting Access to Specific Modules
- Exposes Vector methods
- Because `Stack` extends `Vector`, you can accidentally access elements by index or insert in the middle, breaking the LIFO (Last-In-First-Out) contract that stacks should enforce.
- Lesson 1211 — Why Deque Is Preferred Over Stack Class
- expression body
- lambda, and it's the most concise form you can write.
- Lesson 1703 — Expression Body: Single Statement LambdasLesson 1705 — Explicit return in Block Bodies
- Expression body (single statement)
- Lesson 1704 — Block Body: Multiple Statements with Braces
- extend
- your hand to **get** (produce) items from it.
- Lesson 939 — The PECS Principle: Producer Extends, Consumer SuperLesson 2571 — Creating a Thread with the Thread Class
- Extending classes
- Lambdas only work with interfaces, not class extension
- Lesson 649 — When to Prefer Lambdas Over Anonymous Classes
- Extensibility
- Add specialized behavior without modifying the original class
- Lesson 393 — What Is Inheritance? The extends KeywordLesson 713 — Protected Access in Inheritance: The Protected ModifierLesson 2499 — The java.util.ServiceLoader Class
- External resources
- Any resource obtained from outside your Java program (system handles, native memory) needs explicit cleanup.
- Lesson 734 — Common finally Use Cases: Resource Cleanup
- External service calls
- Network requests that might hang
- Lesson 2742 — get() with Timeout: Avoiding Indefinite Blocking
- Externalizable
- You rapidly throw items in according to your own efficient system—no questions asked.
- Lesson 2153 — Performance Benefits of Externalizable
- Extra memory
- Each entry stores two additional references (previous and next nodes)
- Lesson 1079 — Performance Characteristics
- Extra object overhead
- Each node carries pointer references
- Lesson 1227 — Performance Characteristics of Sorting
- Extra pointer updates
- Adding an element requires updating linked list pointers (making the new node the tail)
- Lesson 1079 — Performance Characteristics
- Extra unlinking
- Removing an element requires adjusting two pointers to bypass the removed node
- Lesson 1079 — Performance Characteristics
- Extract
- (if using archive): Unpack to a directory like `/opt/jdk-[version]`
- Lesson 4 — Installing the JDK on Your Operating System
- Extracting properties
- Getting unique ages, departments, or categories from objects
- Lesson 1483 — Using distinct After Transformations
F
- factory
- is a design pattern that centralizes object creation logic.
- Lesson 1670 — Suppliers for Factory PatternsLesson 2719 — The Executors Factory Class Overview
- factory methods
- that create implementations:
- Lesson 519 — Use Cases for Static Interface MethodsLesson 594 — Static Fields and Methods in EnumsLesson 870 — Generic Static Methods: Utility Method PatternsLesson 1244 — Immutable Factory Methods: List.of, Set.of, Map.ofLesson 1333 — Comparator.naturalOrder and Comparator.reverseOrderLesson 1665 — What is Supplier<T> and When to Use ItLesson 1753 — Common Patterns and Use Cases
- fail-fast
- iterators that immediately throw `ConcurrentModificationException` when they detect structural modifications during iteration.
- Lesson 1305 — What Is Fail-Safe Behavior?Lesson 1307 — ConcurrentHashMap and Weakly Consistent IteratorsLesson 1308 — Choosing Fail-Fast vs Fail-Safe
- fail-fast behavior
- the iterator fails immediately and predictably rather than risking unpredictable results.
- Lesson 1157 — Iterators and ConcurrentModificationExceptionLesson 1290 — ConcurrentModificationException with ListIteratorLesson 1300 — What Is Fail-Fast Behavior?
- Fail-fast collections
- offer better performance in single-threaded or well-synchronized contexts.
- Lesson 1308 — Choosing Fail-Fast vs Fail-Safe
- Fail-fast scenarios
- Better to timeout and retry than wait forever
- Lesson 2742 — get() with Timeout: Avoiding Indefinite Blocking
- Fail-safe
- iterators take the opposite approach: they work on a **copy or snapshot** of the collection's data, so changes to the original collection don't affect the iteration in progress.
- Lesson 1305 — What Is Fail-Safe Behavior?Lesson 1308 — Choosing Fail-Fast vs Fail-Safe
- Fail-safe collections
- handle concurrency automatically but at a cost:
- Lesson 1308 — Choosing Fail-Fast vs Fail-Safe
- Fails `contains()` checks
- Searching for an object looks in the wrong bucket because the hash code doesn't match what was used during insertion
- Lesson 1086 — Breaking HashSet with Bad hashCode
- Fairness guarantees
- Ensuring no item "cuts in line"
- Lesson 1218 — Stack vs Queue Trade-offs in Problem Solving
- Fall back
- to a default value or alternative approach
- Lesson 2754 — Timeout-Based Result Retrieval with get(timeout)
- false
- Lesson 280 — Default Values: Primitives vs ReferencesLesson 456 — Pattern Matching with Logical OperatorsLesson 1070 — The Critical equals-compareTo ContractLesson 2685 — volatile Does Not Provide Atomicity for Compound Actions
- Fast deletions
- Remove pairs by key in constant time
- Lesson 997 — HashMap: Key-Value Pairs with Hashing
- Fast insertions
- Add new key-value pairs in constant time
- Lesson 997 — HashMap: Key-Value Pairs with Hashing
- Faster
- than `HashSet` for enum collections
- Lesson 597 — Introduction to EnumSet: A Specialized Set for Enums
- Faster startup
- Less code to load means quicker initialization.
- Lesson 2544 — What is jlink and Why Custom Runtime Images MatterLesson 2552 — Comparing jlink Images to Traditional Deployments
- Favor package-private over protected
- Only use `protected` when inheritance-based extension is truly needed
- Lesson 712 — Cross-Package Access Patterns and Best Practices
- Fewer errors
- You only write the variable name once, reducing typos
- Lesson 129 — Assignment Operators: =, +=, -=, *=, /=, %=Lesson 173 — Iterating Arrays with Enhanced for LoopsLesson 2234 — What Are Text Blocks?
- Fewer resizes needed
- as the collection grows large
- Lesson 1033 — Vector Growth Strategy: Doubling Capacity
- Fewer Resources to Save
- A thread context switch only needs to save and restore:
- Lesson 2559 — Context Switching Costs
- Field initializers
- (in declaration order, top to bottom)
- Lesson 354 — Complete Initialization Sequence: Fields, Blocks, Constructor
- Field initializers execute first
- , then the constructor body runs.
- Lesson 351 — Order of Initialization: Fields Before Constructor Body
- Fields
- (variables declared at the class level) receive automatic default values if you don't initialize them.
- Lesson 67 — Default Values for Fields vs Local VariablesLesson 306 — Fields: Instance Variables in a ClassLesson 331 — Access Modifiers on ClassesLesson 356 — Initialization Order with Constructor ChainingLesson 2336 — Getting Fields with getFields()
- Fields get defaults
- Lesson 67 — Default Values for Fields vs Local Variables
- FIFO (First-In-First-Out)
- ordering.
- Lesson 1167 — Queue Interface Overview and FIFO SemanticsLesson 1179 — FIFO Semantics with LinkedList
- FIFO discipline
- processing items in order from front to back.
- Lesson 1177 — Queue vs List Methods on LinkedList
- File handles
- – point to system resources that may not exist later
- Lesson 2136 — Use Case: Non-Serializable References
- File handling
- Close file readers/writers to release operating system handles.
- Lesson 734 — Common finally Use Cases: Resource Cleanup
- File locking
- Coordinate access across multiple processes
- Lesson 1955 — File Channel and Memory-Mapped I/O Preview
- File locks
- On some systems, unclosed output streams prevent other processes from reading the file
- Lesson 1942 — Why Closing Streams Matters: Resource Leaks Explained
- File locks persist
- , preventing deletion or modification by other processes
- Lesson 1911 — The close() Method and Stream Lifecycle
- File name
- = the label on the cabinet's exterior
- Lesson 9 — Anatomy of a Java Source FileLesson 747 — Stack Traces and Debugging Propagated Exceptions
- File objects
- when you need file metadata or path manipulation.
- Lesson 1969 — Creating FileReader Instances with File Paths
- File operations
- If a file doesn't exist (`FileNotFoundException`), the caller might prompt the user for a different filename, create the file, or use a default.
- Lesson 789 — When to Use Checked Exceptions: Recoverable Conditions
- File streams
- The operating system might buffer more data than `available()` reports
- Lesson 1909 — The available() Method and Stream Availability
- File tree walking
- is the process of systematically visiting every file and directory in a tree structure, starting from a root directory and recursively exploring all branches.
- Lesson 2084 — Introduction to File Tree Walking
- FileDescriptor
- only in specialized scenarios involving system-level file handles.
- Lesson 1969 — Creating FileReader Instances with File Paths
- FileNotFoundException
- if the file doesn't exist → log an error, use default data
- Lesson 756 — The Need for Multiple catch Blocks
- Files are small
- (typically under a few megabytes)
- Lesson 2048 — Memory Considerations When Reading Entire Files
- Files.readAllLines()
- is like loading an entire grocery list into your shopping cart at once—quick and convenient, but your cart needs to fit everything.
- Lesson 2015 — Alternative: Files.readAllLines vs readLine Loop
- Files.readAttributes()
- lets you *read* file metadata, NIO.
- Lesson 2073 — Files.setAttribute() and Files.setLastModifiedTime()
- Filter early
- Apply filters before collecting to avoid processing unnecessary paths
- Lesson 2093 — Performance and Resource Management in Walks
- Filter object streams
- Use `ObjectInputFilter` (Java 9+) or `ValidatingObjectInputStream` to whitelist acceptable classes before deserialization happens.
- Lesson 2166 — Best Practices for Safe Serialization
- final
- to prevent inheritance headaches entirely, or carefully documenting that subclasses must not add fields.
- Lesson 291 — equals with Inheritance: Challenges and SolutionsLesson 608 — The name() Method: Getting the Enum Constant's IdentifierLesson 832 — Pre-Initialized Resources (Java 9+)
- Final Round
- When no new files are generated, a final round occurs with `processingOver()` returning `true`.
- Lesson 2457 — The RoundEnvironment and Processing Rounds
- Financial applications
- – More accuracy prevents compounding errors
- Lesson 46 — When to Use double Over float
- Finding dependencies is manual
- You must search for string literals, which could be concatenated or computed
- Lesson 2396 — Maintaining Code with Reflection
- Finding min/max
- The collector methods leverage `BinaryOperator.
- Lesson 1689 — Real-World Use Cases: Operators in Stream API
- Fine-grained
- Small synchronized blocks protecting only the critical section (the actual shared data access).
- Lesson 2666 — Synchronized Block Scope and Granularity
- finisher
- is the fourth component of the `Collector` interface.
- Lesson 1619 — Finisher: Transforming the Accumulator to Final ResultLesson 1622 — Custom Collector Example: Immutable Collection
- first
- , then use the new value
- Lesson 97 — Prefix vs Postfix: Evaluation OrderLesson 844 — Suppression OrderLesson 920 — What Are Multiple Bounds in Generics?Lesson 1268 — Collections.indexOfSubList and lastIndexOfSubListLesson 1355 — Order of Operations: reversed() vs Null MethodsLesson 2858 — CompletableFuture.anyOf: Racing Multiple Futures
- First `awaitTermination()`
- waits a reasonable time (adjust 60 seconds to your needs)
- Lesson 2775 — Common Shutdown Patterns and Best Practices
- First downstream collector
- – computes one result (e.
- Lesson 1609 — Basic teeing Example: Min and Max in One Pass
- first parameter
- of your functional interface becomes the target object.
- Lesson 1738 — Instance Method References on Arbitrary ObjectsLesson 1742 — Method References vs Lambda Parameter OrderLesson 2844 — The handle Method: Signature and Purpose
- first statement
- in your subclass constructor, just like `this()`.
- Lesson 405 — The super() Constructor CallLesson 408 — Calling Specific Superclass Constructors with super(args)
- First traversal
- Iterating through the stream to build the list
- Lesson 1613 — Performance Benefits of teeing Over Multiple Passes
- First/last access
- Quickly retrieve the smallest or largest element/key
- Lesson 974 — SortedSet and SortedMap: Ordered Collections
- Fisher-Yates algorithm
- (also called the Knuth shuffle), which guarantees uniform distribution—every permutation of your list is equally likely.
- Lesson 1231 — Collections.shuffle: Randomizing List Order
- Fix
- Make fields `private` and provide controlled access through methods.
- Lesson 336 — Common Access Modifier Mistakes
- fixed offset
- from UTC, like "+05:30" or "-08:00".
- Lesson 1855 — ZoneOffset vs ZoneId: Fixed vs Region-BasedLesson 1870 — OffsetDateTime vs ZonedDateTime
- Fixed offset suffices
- Use `OffsetDateTime` when you only need the UTC offset, not full zone rules (DST transitions don't matter).
- Lesson 1856 — Best Practices: When to Use ZonedDateTime
- Fixed pool
- Bounded resource usage, prevents thread explosion, better for steady loads
- Lesson 2865 — Creating Dedicated Thread Pools for CompletableFuture
- Fixed-size collections
- Arrays converted to lists that can't grow or shrink
- Lesson 802 — UnsupportedOperationException in Collections
- Flags
- `-` (left-align), `0` (zero-pad), `+` (show sign), `,` (locale grouping)
- Lesson 2228 — Formatting Numbers with PrecisionLesson 2253 — Compiling with Flags
- Flattens
- all those individual streams into a single stream
- Lesson 1436 — What flatMap Does: Flattening Nested StructuresLesson 1805 — Optional.flatMap: Flattening Nested Optionals
- Flexibility
- Force customization only where needed
- Lesson 481 — Concrete Methods in Abstract ClassesLesson 984 — Queue vs Deque: Choosing the Right End-Access PatternLesson 1357 — Sorting Lists with List.sort()Lesson 2349 — Type Safety and IllegalArgumentException RisksLesson 2478 — Combining requires Modifiers
- Flexibility to change
- Non-exported packages are invisible to other modules.
- Lesson 2488 — Best Practices: Minimizing Exported API Surface
- Flexibility vs Optimization
- A full JDK runs *any* Java application; a `jlink` image runs *only* the modules you included.
- Lesson 2552 — Comparing jlink Images to Traditional Deployments
- floating-point types
- `float` and `double`.
- Lesson 38 — Introducing Floating-Point Types: float and doubleLesson 90 — Division by Zero: Runtime Exceptions and Special Values
- Flushes buffered data
- (writes any pending bytes to disk)
- Lesson 1911 — The close() Method and Stream Lifecycle
- Flushes remaining data
- `close()` automatically calls `flush()` before releasing resources, ensuring no buffered data is lost.
- Lesson 1921 — Flushing and Closing: flush() and close() Methods
- Follow the wizard
- Click "Next" through the installation screens, accepting the default installation location (usually `C:\Program Files\Java\jdk-[version]`)
- Lesson 4 — Installing the JDK on Your Operating System
- Follows `requires transitive`
- edges to include indirect dependencies
- Lesson 2476 — The Readability Graph
- For clarity
- When the lambda is complex or the context isn't obvious, explicit types make your code self- documenting:
- Lesson 1706 — Parameter Type Declaration: Explicit Types
- For consistency
- In a team codebase with style guidelines, explicit types might be preferred for uniformity.
- Lesson 1706 — Parameter Type Declaration: Explicit Types
- For each entry
- , recalculate its bucket index using the new capacity
- Lesson 1126 — The Rehashing Process: Doubling Capacity
- For enums
- You must either list all enum constants or include a `default` case.
- Lesson 151 — Exhaustiveness in Switch Expressions
- For frequently modified lists
- , accept some wasted space as the cost of speed.
- Lesson 1010 — Memory Implications of Capacity Management
- For high-concurrency scenarios
- Lesson 1035 — When Not to Use Vector in Modern Code
- For infinite streams
- , short-circuiting is the difference between a working program and one that hangs forever.
- Lesson 1416 — Performance Benefits of Short-Circuiting
- For instance variables
- remember that `this` references are fine to capture—lambdas naturally work with the enclosing object's state.
- Lesson 1726 — Best Practices for Variable Capture
- For large streams
- , short-circuiting can dramatically reduce processing time.
- Lesson 1416 — Performance Benefits of Short-Circuiting
- For long-lived lists
- that won't grow further, call `trimToSize()` after bulk inserts to reclaim memory.
- Lesson 1010 — Memory Implications of Capacity Management
- For multi-dimensional arrays
- Lesson 2377 — Creating Arrays Reflectively with Array.newInstance
- For multi-threaded applications
- , use `ConcurrentHashMap`.
- Lesson 1158 — Migrating from Hashtable to Modern Alternatives
- For no-argument methods
- , pass nothing (or an empty array):
- Lesson 2346 — Passing Arguments: Varargs and Array Wrapping
- For primitive types
- (like `int`, `char`): You must include a `default` case, since there are too many values to list individually.
- Lesson 151 — Exhaustiveness in Switch Expressions
- For primitives
- The *actual data value* is copied.
- Lesson 279 — Assignment Semantics: Primitives vs References
- For reference types
- The *memory address* (reference) is copied, not the object itself.
- Lesson 279 — Assignment Semantics: Primitives vs References
- For regular methods
- , pass arguments directly:
- Lesson 2346 — Passing Arguments: Varargs and Array Wrapping
- For single-dimensional arrays
- Lesson 2377 — Creating Arrays Reflectively with Array.newInstance
- For single-threaded applications
- , use `HashMap`.
- Lesson 1158 — Migrating from Hashtable to Modern Alternatives
- Forces all concrete subclasses
- to provide an implementation
- Lesson 480 — Abstract Method Syntax and Rules
- Forgetfulness
- It's easy to skip a null check when you're focused on business logic
- Lesson 1755 — Traditional null Checking: Verbose and Error-Prone
- Forgetting close() entirely
- In the rush of development, programmers sometimes open a resource and simply forget to close it.
- Lesson 849 — Manual close() Calls Are Error-Prone
- Forgetting escape sequences
- To print a literal `%`, use `%%`.
- Lesson 2233 — Common Formatting Patterns and Pitfalls
- Forgetting null checks
- If resource initialization fails, your variable might be `null`.
- Lesson 849 — Manual close() Calls Are Error-Prone
- ForkJoinPool.commonPool()
- by default.
- Lesson 2781 — Async Execution Models: Common vs Custom Executors
- Formal parameters
- (also called "parameters") are the variables you declare in the method signature.
- Lesson 197 — Method Parameters: Formal vs Actual Parameters
- format specifiers
- , followed by values to insert at those positions.
- Lesson 2019 — printf and format: Formatted OutputLesson 2227 — Basic Formatting Syntax
- Formatted output
- Supports printf-style formatting for precise control
- Lesson 2016 — PrintWriter Overview: Formatted Text Output
- Formatting nested structures
- XML, JSON, or configuration files
- Lesson 2221 — The indent Method: Adding Leading Whitespace
- Formatting SQL IN clauses
- Lesson 1562 — joining(delimiter, prefix, suffix): Full Control
- Forward-Backward Scan
- Start at the beginning, move forward until you find something interesting, then scan backward to examine context or related elements.
- Lesson 1289 — Bidirectional Iteration Patterns
- Foundation for learning
- Once you understand `ArrayList<E>`, other generic collections (`HashMap<K,V>`, `LinkedList<E>`) make immediate sense
- Lesson 900 — ArrayList<E> as the Canonical Generic Collection
- Fragile configurations
- Missing JARs only surface when code paths execute
- Lesson 2516 — Classpath Mechanics: How the JVM Finds Classes
- Framework Dependency
- Opening packages couples your design to specific frameworks.
- Lesson 2497 — Security and Design Trade-offs with opens
- Framework detection
- The JVM's serialization mechanism checks `instanceof Serializable` at runtime—interfaces work perfectly for type checks.
- Lesson 530 — Marker Interfaces vs Empty Abstract Classes
- Framework internals
- Share utility packages with your framework's companion modules without exposing them publicly.
- Lesson 2484 — Multiple Qualified exports for Fine-Grained Control
- Frameworks
- Spring's `@Autowired`, JPA's `@Entity`, JAX-RS's `@Path` all use `RUNTIME` retention
- Lesson 2438 — RetentionPolicy.RUNTIME Explained
- Frameworks and libraries
- Testing frameworks (JUnit) call your test methods without knowing their names in advance
- Lesson 2341 — Overview of Method.invoke and Its PurposeLesson 2370 — Why Create Instances ReflectivelyLesson 2494 — Open Modules: Making All Packages Reflectively Accessible
- Freedom to refactor
- You can change or remove private methods without breaking any implementing classes
- Lesson 523 — Visibility Rules: Private Methods Cannot Be Overridden
- Frequent Insertions and Deletions
- Lesson 992 — LinkedList: When to Use It
- Frequent iteration
- Looping through all elements is very fast
- Lesson 980 — ArrayList vs LinkedList: Access Patterns Matter
- Frequent small operations
- The lock overhead becomes significant relative to the actual work
- Lesson 1251 — Performance Implications of Synchronized Wrappers
- From TERMINATED
- Lesson 2588 — State Transitions: Valid Paths Between States
- From TIMED_WAITING
- Lesson 2588 — State Transitions: Valid Paths Between States
- FULL
- Complete, formal representation (e.
- Lesson 1892 — Localized Formatting with ofLocalizedDate and ofLocalizedTime
- Full accessibility
- The module is opened for reflection to all other modules
- Lesson 2536 — How JARs Become Automatic Modules
- Full lambda syntax
- Lesson 2807 — thenAccept Signature and Lambda Usage
- fully qualified class name
- that is, the complete package path plus the class name.
- Lesson 664 — Running Packaged ClassesLesson 753 — Stack Trace Information
- fully qualified name
- , and it uniquely identifies each class.
- Lesson 658 — What Are Packages and Why They MatterLesson 677 — Using FQNs to Resolve Name ConflictsLesson 2324 — Using Class.forName() for Dynamic Loading
- Fully Qualified Name (FQN)
- is the complete, unambiguous name of a class that includes its entire package hierarchy followed by the class name itself.
- Lesson 676 — What Is a Fully Qualified Name (FQN)?
- Fully terminated
- All tasks completed, no threads active
- Lesson 2774 — isShutdown() and isTerminated() Status Methods
- fully-qualified name
- with the outer class as a prefix:
- Lesson 615 — Declaring and Instantiating Static Nested ClassesLesson 2325 — Getting Class Name Information
- function
- that extracts the property you want to compare.
- Lesson 1338 — Comparator.comparing() with Method ReferencesLesson 1629 — Common Functional Interfaces in java.util.function
- functional interface
- is an interface with exactly one abstract method (like `Comparator`, `Runnable`, or custom interfaces you create).
- Lesson 650 — Anonymous Classes as Functional Interface ImplementationsLesson 1330 — Comparator as a Functional InterfaceLesson 1624 — Definition of a Functional InterfaceLesson 1631 — Functional Interfaces vs Regular InterfacesLesson 2564 — Lambda Expressions with RunnableLesson 2570 — Runnable as a Functional Interface
- Fusion optimization
- The JVM can combine multiple operations into a single pass over the data
- Lesson 1406 — Why Laziness Matters for Performance
- Future evolution is private
- You control all subclasses and can modify freely
- Lesson 532 — Decision Criteria: A Practical Checklist
G
- Game loops
- continuously checking input and rendering frames
- Lesson 169 — Omitting for Loop Components: Infinite Loops
- Garbage collection
- (the JVM's built-in daemon thread)
- Lesson 2618 — What Are Daemon Threads?Lesson 2623 — Common Use Cases for Daemon Threads
- Garbage collection pressure
- from temporary wrapper objects
- Lesson 1388 — IntStream, LongStream, DoubleStream from Primitive Arrays
- gatekeeper
- , ensuring only valid data gets stored in your private fields.
- Lesson 343 — Validation Logic in SettersLesson 2468 — Module Descriptors and Accessibility Rules
- Gather
- Use `join()` to wait for all threads to complete before processing their collective results
- Lesson 2616 — Common join Patterns: Scatter-Gather
- GC behavior
- Interned strings now participate in regular heap GC cycles
- Lesson 2182 — Intern Pool Location: PermGen vs Metaspace
- General-purpose decimal math
- – Java expects `double` by default
- Lesson 46 — When to Use double Over float
- Generating patterns
- Lesson 2219 — The repeat Method: Duplicating Strings
- generic class
- is like a template that can hold or operate on different types without knowing in advance what those types will be.
- Lesson 856 — Declaring a Generic Class with a Single Type ParameterLesson 872 — Generic Constructors
- Generic method calls
- where type parameters can't be inferred
- Lesson 1731 — Target Type from Cast Expressions
- generic static methods
- in utility classes where making the entire class generic would be inappropriate or awkward.
- Lesson 870 — Generic Static Methods: Utility Method PatternsLesson 878 — Static Context and Type Parameters
- Generic type `T`
- = `Integer` (from the argument `42`)
- Lesson 1733 — Target Typing with Generic Methods
- Generic type erasure
- At runtime, `ArrayList<String>` and `ArrayList<Integer>` both become just `ArrayList` due to type erasure.
- Lesson 960 — Cannot Create Arrays of Parameterized Types
- Generic utilities
- Tools that operate on any object type
- Lesson 2341 — Overview of Method.invoke and Its Purpose
- Geographic failover
- Querying multiple data centers simultaneously and accepting the first response
- Lesson 2767 — Use Cases: invokeAll vs invokeAny
- get
- (produce) items from it.
- Lesson 939 — The PECS Principle: Producer Extends, Consumer SuperLesson 988 — Performance Characteristics Summary: Big-O Complexities
- Get compile-time type safety
- The compiler prevents you from putting an `Integer` into a `Box<String>`
- Lesson 858 — Instantiating Generic Classes with Type Arguments
- Getter/setter protection
- when multiple fields must stay consistent
- Lesson 2660 — When to Use Synchronized Methods
- Getters
- (`getFieldName()`) let others *read* a field's value
- Lesson 338 — The Purpose of Getters and SettersLesson 723 — Prefer private Fields with Controlled Public Methods
- Glob patterns
- are simple wildcard expressions:
- Lesson 2076 — Filtering Directory Entries with Glob Patterns
- Going down (pushing frames)
- Lesson 228 — Tracing Recursive Execution: The Call Stack
- Good example (concrete type)
- Lesson 947 — PECS and Return Types: When Not to Use Wildcards
- Good performance
- Lesson 1112 — Performance Characteristics: O(1) Average Case
- Graceful shutdown
- (`shutdown()`) is like announcing "no new customers" at a restaurant while letting everyone already seated finish their meals.
- Lesson 2768 — Understanding Graceful vs Immediate Shutdown
- Gradual migration
- Converting existing code piece-by-piece
- Lesson 2032 — Converting Between Path and File
- Gradually migrate dependencies
- as they release modular versions or as you have time to modularize them yourself
- Lesson 2527 — The Top-Down Migration Strategy
- Granular handling
- means catching specific exception types with targeted responses:
- Lesson 764 — Granular vs General Exception Handling
- Graph construction
- Build a directed graph where nodes are modules and edges are dependencies
- Lesson 2470 — Module Graph and Dependencies at Runtime
- Graphics/game programming
- – Some GPU operations prefer `float`
- Lesson 46 — When to Use double Over float
- greater than
- Is the left value larger?
- Lesson 104 — Relational Operators: ==, !=, <, >, <=, >=Lesson 1313 — Return Values: Negative, Zero, Positive
- Grids and matrices
- `ArrayList<ArrayList<Integer>>`
- Lesson 909 — Collections of Collections: Nested Generics
- Group 1
- = `((A)(B))` — the outermost parentheses (opens first)
- Lesson 2268 — Nested Groups and Group Numbering
- Group 3
- = `(B)` — opens third, also nested inside group 1
- Lesson 2268 — Nested Groups and Group Numbering
- Group Related Exceptions
- Lesson 765 — Catch Order Best Practices
- Grouped by domain
- (arrays, collections, objects, math)
- Lesson 392 — Real-World Examples: Java Standard Library
- Grouped data
- `ArrayList<HashSet<String>>` for sets of tags per item
- Lesson 909 — Collections of Collections: Nested Generics
- Grouping operations
- organizing stream elements into categories (like grouping by key)
- Lesson 1522 — Why collect Is the Gateway to Advanced Collectors
- guaranteed
- to match your declaration order.
- Lesson 582 — The values() Method: Iterating All ConstantsLesson 931 — Reading from <? extends T> CollectionsLesson 2707 — Fair vs Unfair Locks
H
- Handle errors
- with callbacks, not just try-catch blocks
- Lesson 2777 — What is CompletableFuture and Why Use It?
- Handle exhaustion
- Operating systems limit the number of open files or sockets per process.
- Lesson 848 — The Problem of Resource Leaks
- Handles empty streams gracefully
- If the stream is empty, the result is `0.
- Lesson 1590 — The averagingInt, averagingLong, and averagingDouble Collectors
- Handling recurring events
- When events repeat based on local time ("every Monday at 10 AM"), regardless of DST changes.
- Lesson 1856 — Best Practices: When to Use ZonedDateTime
- Handling requests
- where some users or operations have higher priority
- Lesson 1183 — What Is a PriorityQueue?
- happens-before
- the lock acquisition in `read()`, so `read()` is guaranteed to see `sharedValue = 42`.
- Lesson 2667 — Lock Acquisition and Release SemanticsLesson 2670 — Visibility Guarantees of Synchronized BlocksLesson 2689 — volatile in the Java Memory Model: Formal Guarantees
- Hard to defend
- You can't easily "sanitize" serialized data without deserializing it first
- Lesson 2158 — Serialization as an Attack Vector
- hash collisions
- .
- Lesson 551 — The Cantor Principle: Why the Contract Is Not BidirectionalLesson 1102 — HashMap Structure: Arrays of Buckets
- Hash-based lookups
- O(1) average case per element
- Lesson 1448 — Performance Implications of distinct on Large Streams
- hashing
- to organize elements into "buckets," which makes adding, removing, and checking for existence extremely fast.
- Lesson 993 — HashSet: Unique Elements with HashingLesson 997 — HashMap: Key-Value Pairs with Hashing
- HashMap
- is general-purpose—it works with any object as a key, computes hash codes, handles collisions, and maintains buckets.
- Lesson 601 — Introduction to EnumMap: A Specialized Map for Enum KeysLesson 982 — HashMap vs TreeMap: When Sorted Keys Are Worth the CostLesson 999 — TreeMap: Sorted Map with Ordered Keys
- HashMap calls `key.hashCode()`
- this returns an integer
- Lesson 1103 — Hash Functions and hashCode() in HashMap
- HashMap/HashSet
- Adding or removing keys/elements
- Lesson 1304 — Fail-Fast in HashMap and Other Collections
- HashSet
- Default choice when you need fast lookups and don't care about order
- Lesson 981 — HashSet vs TreeSet: Performance vs Ordering Trade-offsLesson 1075 — Performance Trade- offs: TreeSet vs HashSetLesson 1080 — Iterating LinkedHashSetLesson 1083 — Choosing Between HashSet and LinkedHashSet
- HashSet deduplication
- Adding equal objects shouldn't increase size
- Lesson 1093 — Testing Your equals and hashCode Implementations
- Hashtable
- has synchronization baked directly into its methods.
- Lesson 1156 — Thread Safety: Hashtable vs Collections.synchronizedMap
- heap
- .
- Lesson 235 — Array as Reference TypesLesson 296 — Stack vs Heap: References and ObjectsLesson 2555 — Memory Isolation: Processes vs Threads
- Heap pollution
- occurs when a variable of a parameterized type (like `List<String>`) actually refers to an object of a different parameterized type (like `List<Integer>`).
- Lesson 223 — Generic Varargs and Heap PollutionLesson 888 — Heap Pollution from Raw Types
- Heavy use
- of utility methods (`Math`, custom utilities)
- Lesson 377 — Importing Static Methods and Fields
- Helper classes
- support a public-facing class but shouldn't be used directly by clients
- Lesson 724 — Package-Private for Implementation Cohesion
- Helper logic
- that needs to manipulate the outer class's internals
- Lesson 630 — Inner Classes and Encapsulation
- Here's the problem
- These two approaches are functionally identical.
- Lesson 1776 — The Anti-Pattern: if (opt.isPresent()) opt.get()
- Hexadecimal
- (`0x`): very common for colors, memory addresses, and compact bit representation
- Lesson 35 — Binary, Octal, and Hexadecimal Integer LiteralsLesson 56 — Integer Literals: Decimal, Hexadecimal, Octal, and Binary
- Hexadecimal color code
- Lesson 2301 — Quantifiers with Character Classes: Practical Patterns
- Hibernate and ORM
- Lesson 2368 — Legitimate Use Cases: Frameworks and Serialization
- Hibernate's ORM Mapping
- Hibernate uses reflection to map your Java objects to database tables.
- Lesson 2388 — Common Use Cases: Frameworks and Libraries
- hidden
- the compiler uses the *reference type at compile time* to decide which version to call (static binding)
- Lesson 466 — Hiding vs Overriding: Static Method BehaviorLesson 2069 — Files.isSymbolicLink() and Files.isHidden()
- Hidden assumptions
- Methods returning null don't clearly signal "I might give you nothing"
- Lesson 1755 — Traditional null Checking: Verbose and Error-Prone
- Hidden errors
- Exceptions thrown in `finalize` are silently ignored
- Lesson 300 — The finalize Method (Deprecated)
- Hidden fields
- When both classes have a field with the same name (though this is rare and often discouraged)
- Lesson 403 — The super Keyword: Accessing Superclass Members
- Hidden members
- Private members that exist in the parent portion of the object but remain completely inaccessible to subclass code
- Lesson 716 — Private Members Are Not Inherited
- Hide complexity
- Show only what users need to know
- Lesson 723 — Prefer private Fields with Controlled Public Methods
- Hide implementation details
- you might want to change later
- Lesson 722 — Default to Most Restrictive: The Principle of Least Privilege
- hiding
- it, not overriding it.
- Lesson 422 — static Methods Cannot Be OverriddenLesson 466 — Hiding vs Overriding: Static Method Behavior
- High load factor
- Overloaded buckets mean longer chains to search
- Lesson 1112 — Performance Characteristics: O(1) Average Case
- High read-to-write ratio
- If 90% of operations are reads, you're unnecessarily blocking readers from each other
- Lesson 1251 — Performance Implications of Synchronized Wrappers
- High-performance concurrent access
- (use `ConcurrentHashMap` instead)
- Lesson 1254 — When to Use Synchronized Wrappers
- Higher load factor
- (e.
- Lesson 1057 — What Is Load Factor in HashSet?Lesson 1065 — Choosing Load Factor: Space vs Time Trade-offsLesson 1123 — Understanding Load Factor: Capacity vs Size
- highest priority
- (or lowest value, by default).
- Lesson 1183 — What Is a PriorityQueue?Lesson 1187 — Retrieving the Head: peek and poll
- Historically proven
- This size has been tested over decades of Java applications and works well for typical file sizes and disk block sizes on most operating systems.
- Lesson 1935 — Default Buffer Size: 8KB Explained
- Holidays
- Independence Day is July 4th, regardless of time zones
- Lesson 1836 — LocalDate: Representing Dates Without Time
- how
- the balance changes, preventing invalid states (like negative balances when that's not allowed).
- Lesson 327 — private: Class-Level EncapsulationLesson 514 — Default Methods Cannot Access Instance StateLesson 1615 — The Collector Interface: Anatomy of a CollectorLesson 2080 — DirectoryStream vs Files.list: When to Use Which
- How it works
- Lesson 293 — Objects.equals: Null-Safe Comparison UtilityLesson 1809 — Real-World Example: Safe Property Access
- How they work
- Every method acquires a lock on the entire collection before executing.
- Lesson 986 — Synchronized Collections vs Concurrent Collections
- How to run it
- The execution policy hidden behind the implementation
- Lesson 2710 — The Executor Interface: Decoupling Task Submission from Execution
- However
- If you must search by index or value first, that's still O(n)
- Lesson 1041 — Time Complexity: Removal Operations
- Human readability
- JSON and XML are easy to inspect and debug
- Lesson 2165 — Alternatives to Java Serialization
- Human-readable
- Represents dates as they appear on calendars: year-month-day (2024-03-15).
- Lesson 1836 — LocalDate: Representing Dates Without Time
- Human-readable data
- Serialized bytes are gibberish to humans.
- Lesson 2111 — When to Use and Avoid Serialization
I
- IDE hints
- that help developers but don't affect runtime behavior
- Lesson 2434 — RetentionPolicy.SOURCE Explained
- Ideal for read-heavy workloads
- Perfect when you iterate frequently but modify rarely
- Lesson 1306 — CopyOnWriteArrayList: A Fail-Safe Example
- Idempotency
- Your `close()` method should be *idempotent*, meaning calling it multiple times produces the same result as calling it once.
- Lesson 823 — The close() Method Contract
- idempotent
- by convention (calling `close()` multiple times should be safe)
- Lesson 824 — AutoCloseable vs CloseableLesson 827 — Idempotent close() ImplementationLesson 2061 — Files.deleteIfExists: Safe Deletion
- identical
- to `ArrayList<E>`.
- Lesson 907 — LinkedList<E> and Other Generic List ImplementationsLesson 1050 — HashSet contains: Leveraging HashMap containsKey
- identity value
- (starting point) and an accumulator function.
- Lesson 1505 — The Three Forms of reduceLesson 1506 — reduce with Identity: T reduce(T identity, BinaryOperator<T>)
- if
- something is true.
- Lesson 134 — The if Statement: Basic Conditional ExecutionLesson 1790 — Common Pitfalls with orElse Family Methods
- If `-cp` is specified
- Java uses that path *exclusively* and ignores CLASSPATH
- Lesson 691 — The CLASSPATH Environment Variable
- If neither exists
- Java only searches the current directory
- Lesson 691 — The CLASSPATH Environment Variable
- If no
- `CloneNotSupportedException` is thrown
- Lesson 810 — CloneNotSupportedException: Cloning Restrictions
- If no match
- , the JVM **unwinds the stack** one level (returns to the caller)
- Lesson 751 — The Search for a Handler
- If no match exists
- A new node is added to the end of the chain
- Lesson 1108 — put() Operation: Insertion Process
- Ignoring exceptions during close()
- When you call `close()` manually in `finally`, you must wrap it in its own `try-catch` because `close()` can throw exceptions.
- Lesson 849 — Manual close() Calls Are Error-Prone
- Illegal
- Lesson 890 — When Raw Types Are UnavoidableLesson 962 — Cannot Use instanceof with Parameterized Types
- IllegalAccessException
- happens when you try to access something you don't have permission to reach—like attempting to call a private method from outside its class without proper access rights.
- Lesson 811 — ReflectiveOperationException Hierarchy
- IllegalArgumentException
- You passed an invalid argument to a method.
- Lesson 790 — When to Use Unchecked Exceptions: Programming Errors
- IllegalStateException
- You called a method when the object wasn't ready for it.
- Lesson 790 — When to Use Unchecked Exceptions: Programming Errors
- Immediate effect
- The deletion happens synchronously—when the method returns, the file is gone
- Lesson 2060 — Files.delete: Deleting Files and Directories
- Immediate execution
- with no optimization opportunities
- Lesson 1410 — Contrasting Eager Collection Operations
- Immediate shutdown
- (`shutdownNow()`) is like a fire alarm—you kick everyone out immediately.
- Lesson 2768 — Understanding Graceful vs Immediate Shutdown
- immediately
- after reading it:
- Lesson 2156 — Security Considerations with ExternalizableLesson 2829 — thenCombine vs thenCompose: Key Differences
- Immutability
- means the object's state truly cannot change after creation—no methods exist to modify it, and all its fields are unchangeable.
- Lesson 75 — final vs ImmutabilityLesson 1835 — Instant Immutability and Thread SafetyLesson 1899 — Replacing Calendar Arithmetic with Period and DurationLesson 2167 — What Immutability Means for Strings
- Immutability guarantee
- `String` is immutable.
- Lesson 429 — final Classes in the JDK: String and Wrappers
- immutable
- state: data that cannot change after object construction.
- Lesson 727 — Immutability and final: Defensive Access ControlLesson 802 — UnsupportedOperationException in CollectionsLesson 1238 — What Are Unmodifiable Collections?Lesson 1255 — Collections.singleton, singletonList, and singletonMapLesson 1256 — Collections.empty* Factory MethodsLesson 1259 — Collections.nCopies: Repeated ElementsLesson 1512 — reduce vs collect: When to Use WhichLesson 1843 — Immutability and Modification Methods: plus and minus (+1 more)
- Immutable and thread-safe
- Like `Instant`, `LocalDate` objects cannot be modified after creation.
- Lesson 1836 — LocalDate: Representing Dates Without TimeLesson 1885 — DateTimeFormatter Overview and Built-In FormattersLesson 1901 — Thread Safety: Replacing SimpleDateFormat with DateTimeFormatter
- Immutable collections
- Collections from factory methods like `List.
- Lesson 1281 — Why remove() Is Optional and May Throw UnsupportedOperationException
- immutable list
- containing `n` copies of a specified element.
- Lesson 1271 — Collections.nCopies: Creating Immutable Repeated ListsLesson 1556 — Collectors.toUnmodifiableList(): Immutable CollectionsLesson 1619 — Finisher: Transforming the Accumulator to Final Result
- Implement
- the service interface with a concrete class
- Lesson 2503 — Implementing a Service Provider Module
- Implement `readResolve` for singletons
- Protect singleton patterns from being broken by deserialization.
- Lesson 2166 — Best Practices for Safe Serialization
- Implement custom `readObject`/`writeObject`
- to manually handle old formats
- Lesson 2164 — Versioning Problems and Class Evolution
- Implementation classes
- need to share data or methods to accomplish a task together
- Lesson 724 — Package-Private for Implementation Cohesion
- Implementation-specific
- Different `Queue` implementations (like `PriorityQueue`) may have different orderings, but each respects its own `poll()` order
- Lesson 1173 — Queue Iteration Order and Iterator Behavior
- Implicit exports
- All packages in the JAR are automatically exported
- Lesson 2536 — How JARs Become Automatic Modules
- Implicit requires
- The automatic module gains `requires transitive` to all other modules it can see
- Lesson 2536 — How JARs Become Automatic Modules
- implicitly
- a `public static final` constant of type `Day`.
- Lesson 580 — Enum Values Are Public Static Final ConstantsLesson 2473 — Transitive Dependencies: requires transitive
- Implicitly casts the result
- back to the original type
- Lesson 101 — Increment/Decrement with Different Integer Types
- Important constraint
- A `public` class must be in a file with the same name (`BankAccount.
- Lesson 331 — Access Modifiers on ClassesLesson 2612 — join with Milliseconds and Nanoseconds
- Important detail
- Notice the `L` at the end of `384400000L`?
- Lesson 28 — The long Type: Extended Range Integers
- Important limitation
- Initializer lists only work *during declaration*.
- Lesson 238 — Array Initializer ListsLesson 2448 — ElementType.LOCAL_VARIABLE: Annotating Local Variables
- Important quirk
- NaN is *not equal to anything*, including itself!
- Lesson 44 — Special Values: Infinity, -Infinity, and NaN
- Important rule
- `this()` must be the *first* statement in the constructor.
- Lesson 321 — Calling Another Constructor with this()
- Important rules
- Lesson 920 — What Are Multiple Bounds in Generics?
- Improves efficiency
- No instance overhead or memory allocation
- Lesson 367 — Common Use Cases for static Methods: Utility Functions
- Improves readability
- Readers see the variable's purpose immediately, close to where it's used
- Lesson 193 — Best Practices for Variable ScopeLesson 1337 — Introduction to Comparator Factory Methods
- Improves throughput
- No startup delay per task
- Lesson 2712 — Thread Pools: Reusing Threads for Efficiency
- in
- this collection.
- Lesson 171 — The Enhanced for Loop (for-each): Syntax and PurposeLesson 936 — Comparing extends vs super WildcardsLesson 1772 — The isEmpty() Method (Java 11+)
- In a constructor
- For instance variables only (we'll cover constructors later in the course)
- Lesson 71 — final and Initialization Requirements
- In Java I/O
- You typically *read* and *write* UTF-8, but process text internally as UTF-16 (Java strings).
- Lesson 2001 — UTF-16 and UTF-32
- In ordered streams
- , the behavior is predictable:
- Lesson 1468 — Order Preservation with limit and skip
- in parallel
- and combines their results when both complete.
- Lesson 2825 — Understanding thenCombine: Combining Independent FuturesLesson 2829 — thenCombine vs thenCompose: Key Differences
- In the getter
- Return a *copy* of the internal object.
- Lesson 344 — Defensive Copying in Getters and Setters
- in-place
- your original array changes.
- Lesson 266 — Arrays.sort: Sorting Primitive ArraysLesson 1228 — Immutable Lists and Sorting WorkaroundsLesson 1229 — Collections.reverse: Reversing List Order
- In-place operation
- The original list is modified directly; no extra memory for a copy
- Lesson 1230 — Reverse Internals: How Swapping Works
- Inaccessible
- at runtime, even via reflection (by default)
- Lesson 2468 — Module Descriptors and Accessibility Rules
- incompatible changes
- that break deserialization.
- Lesson 2128 — Removing or Renaming Fields: Breaking ChangesLesson 2130 — Best Practices for serialVersionUID Management
- incompatible return types
- Lesson 498 — Interface Method Name ConflictsLesson 501 — Multiple Interfaces with Different Return Types
- Incompatible types
- You pass a `String` where an `Integer` is expected
- Lesson 2349 — Type Safety and IllegalArgumentException Risks
- Inconsistency
- Different developers check differently (early returns vs nested ifs)
- Lesson 1755 — Traditional null Checking: Verbose and Error-Prone
- Inconsistent state
- Internal pointers or indices become invalid
- Lesson 1247 — Why Collections Need Synchronization
- Incorrect Base Condition
- Lesson 230 — Stack Overflow Error: When Recursion Goes Too Deep
- Incorrect paths
- Typos in package names or file paths.
- Lesson 693 — Common Classpath Issues and ClassNotFoundException
- Increment the size counter
- Lesson 1023 — Adding Elements to the End
- Increments modCount
- `add()`, `remove()`, `clear()`, `addAll()`, `removeAll()`, etc.
- Lesson 1301 — The modCount Field in ArrayList
- Independence
- The class has value and meaning on its own, used by multiple unrelated classes
- Lesson 619 — Static Nested Classes vs Top-Level Classes
- Independent Execution
- Despite sharing memory, each thread has its own execution path, program counter, and call stack.
- Lesson 2554 — Thread: A Lightweight Execution Unit
- Independent operations
- that don't all need the same lock
- Lesson 2660 — When to Use Synchronized Methods
- Index access
- Know exactly where you are in the list at any moment.
- Lesson 1282 — The ListIterator Interface Overview
- index position
- (to compare neighbors, skip elements, or print positions)
- Lesson 249 — When to Use Indexed vs Enhanced for LoopsLesson 2197 — The indexOf Method: Finding Character Positions
- Index-Based Operations
- Beyond retrieval, you can insert at specific positions, replace elements, or find the index of an item:
- Lesson 969 — List Interface: Ordered Collections with Duplicates
- Indexed Operations
- You can use familiar operations like `get(index)`, `set(index, element)`, and `add(index, element)` to work with positions directly.
- Lesson 989 — ArrayList: Dynamic Array Fundamentals
- IndexOutOfBoundsException
- You accessed an array or list with an invalid index.
- Lesson 790 — When to Use Unchecked Exceptions: Programming Errors
- Indirection
- May require following pointers or traversing structures
- Lesson 1392 — Collection.stream() vs Arrays.stream() Performance Considerations
- Individual modular JAR files
- Lesson 2518 — Running Modular Applications: --module-path Flag
- infinite loop
- runs forever because its condition never becomes `false`.
- Lesson 157 — Writing Effective while Loop ConditionsLesson 2101 — Handling Watch Service in a Monitoring Loop
- Infinite loops
- Corrupted internal structures (especially in linked data)
- Lesson 1247 — Why Collections Need Synchronization
- Infinite stream support
- You can work with infinite streams because you're not trying to store all elements—just process them as they flow
- Lesson 1409 — No Intermediate Storage
- Infinite streams become usable
- You can take the first 10 elements from an endless generator.
- Lesson 1414 — Intermediate Short-Circuiting: limit Operation
- Infinity
- Represents a positive value too large to express (like `1.
- Lesson 44 — Special Values: Infinity, -Infinity, and NaN
- Inheritance
- | Inherited by classes | NOT inherited |
- Lesson 518 — Static Methods vs Default Methods: Key Differences
- Inheritance access
- Any subclass, *even in a different package*, can access `protected` members
- Lesson 330 — protected: Inheritance and Package Access
- Inherited members
- Fields and methods the subclass can directly access and use (public, protected, package-private if in same package)
- Lesson 716 — Private Members Are Not Inherited
- Inherits from Vector
- `Stack` extends the old `Vector` class, which means it carries unnecessary synchronized overhead on every operation—even in single-threaded programs where synchronization isn't needed.
- Lesson 1211 — Why Deque Is Preferred Over Stack Class
- initial capacity
- and **load factor**—and immediately forward them to the `HashMap` constructor.
- Lesson 1054 — Initial Capacity and Load Factor in HashSetLesson 1125 — When Rehashing Occurs: The Threshold Calculation
- Initialization
- means giving your variable its first real value.
- Lesson 27 — Declaring and Initializing int VariablesLesson 166 — Executing for Loops: Step-by-Step Evaluation OrderLesson 251 — Iterating Arrays in Reverse Order
- Initialization and padding
- Lesson 1271 — Collections.nCopies: Creating Immutable Repeated Lists
- Initialize before the loop
- Always set your control variable's starting value
- Lesson 158 — Loop Control Variables and Counting Patterns
- Initialize carefully
- Lesson 794 — NullPointerException: The Most Common Runtime Error
- Initialize two pointers
- one at index `0` (start), one at `list.
- Lesson 1230 — Reverse Internals: How Swapping Works
- Initializes the memory
- – sets default values (like `0` for numbers, `null` for references)
- Lesson 295 — Object Allocation with new
- Inject mocks
- Replace private dependencies with test doubles
- Lesson 2390 — Testing: Accessing Private Members
- inline
- the method—copy its code directly into the caller instead of making a separate method call.
- Lesson 426 — final Methods and Performance MythsLesson 646 — Use Case: Event Handlers and CallbacksLesson 2402 — JIT Compilation Limits with Reflection
- Inline static field initializers
- Lesson 373 — Static Blocks vs Static Field Initializers
- Inlining
- The JIT may inline the method body directly at the call site, removing the call overhead entirely
- Lesson 468 — Performance Implications of Dynamic DispatchLesson 2402 — JIT Compilation Limits with Reflection
- inner class
- is a non-static nested class declared inside another class.
- Lesson 622 — What Are Inner Classes?Lesson 623 — Declaring an Inner Class
- Inner class fields
- Lesson 629 — Shadowing and Name Resolution in Inner Classes
- Input
- A `Runnable` — an interface with a single method `void run()` that takes no parameters.
- Lesson 2809 — thenRun Signature and Runnable Interface
- Input Parameter
- `exceptionally` takes a `Function<Throwable, T>` where `T` matches your future's result type.
- Lesson 2836 — Basic exceptionally Syntax and Return Type
- InputStream
- is the abstract superclass for all classes that read bytes.
- Lesson 1904 — The InputStream and OutputStream Abstract Classes
- InputStreamReader constructors
- Lesson 1990 — Specifying Charset in Bridge Constructors
- Insertion methods
- Lesson 1168 — Queue Core Methods: add, offer, remove, poll
- Insertion order
- (default): Entries appear in the order they were first added
- Lesson 1142 — LinkedHashMap Overview: Ordering in MapsLesson 1145 — Access Order Mode: The accessOrder ParameterLesson 1555 — Specifying Map Implementation with toMap()
- Insertion order is important
- (reproducible iteration)
- Lesson 1083 — Choosing Between HashSet and LinkedHashSet
- inside
- `BankAccount` (like `getBalance()` or `withdraw()`) can read or modify it.
- Lesson 327 — private: Class-Level EncapsulationLesson 1355 — Order of Operations: reversed() vs Null Methods
- Inspecting
- the head element without removing it
- Lesson 1167 — Queue Interface Overview and FIFO Semantics
- Inspecting elements
- Lesson 972 — Deque Interface: Double-Ended Queue Operations
- Install
- Drag the JDK icon to the Applications folder or run the `.
- Lesson 4 — Installing the JDK on Your Operating System
- instance
- (non-static) when the data or behavior is unique to each object (like a `Person`'s `name` or `age`).
- Lesson 358 — What static Means: Class-Level vs Instance-LevelLesson 458 — instanceof with null: Behavior and GuaranteesLesson 466 — Hiding vs Overriding: Static Method BehaviorLesson 588 — Enum Constructors: Syntax and RestrictionsLesson 869 — Generic Methods in Non-Generic Classes
- Instance fields
- 1,000 desks taking up space
- Lesson 361 — static Fields and Memory: Single CopyLesson 2106 — Automatic Serialization of Instance Fields
- Instance initializer blocks
- (in declaration order, top to bottom)
- Lesson 354 — Complete Initialization Sequence: Fields, Blocks, ConstructorLesson 356 — Initialization Order with Constructor ChainingLesson 645 — Limitations: No Constructors
- instance method
- (belongs to each object created from the class).
- Lesson 205 — Static vs Instance Methods: When to Use thisLesson 2226 — Introduction to String::formattedLesson 2232 — formatted vs String.formatLesson 2601 — Checking Interruption Status: isInterrupted()
- Instance method on parameter
- Lesson 654 — Method References as Further Simplification
- Instance method reference
- Lesson 1651 — Method References as Function Implementations
- Instance methods
- operate on specific objects.
- Lesson 205 — Static vs Instance Methods: When to Use thisLesson 316 — What is this? The Implicit Object ReferenceLesson 466 — Hiding vs Overriding: Static Method BehaviorLesson 2653 — The Implicit Lock (Monitor) of an Object
- Instance State (Fields)
- Lesson 653 — When Lambda Conversion Is Not Possible
- Instance synchronized methods
- lock on `this` (the specific object)
- Lesson 2657 — synchronized static Methods
- Instance variables
- Captured via implicit `this` reference
- Lesson 1722 — Capturing Instance Variables and Static Fields
- Instance-level (non-static)
- Each house built from the blueprint has its own address, its own paint color, its own furniture.
- Lesson 358 — What static Means: Class-Level vs Instance-Level
- Instantiation
- means you're actually creating the array object in memory using the `new` keyword:
- Lesson 243 — Array Declaration vs InstantiationLesson 313 — Creating Objects: Using new with Constructors
- InstantiationException
- is thrown when you try to create an instance of a class that can't be instantiated.
- Lesson 811 — ReflectiveOperationException Hierarchy
- integer
- (`int`) that serves as a numeric fingerprint for an object.
- Lesson 544 — The hashCode Method: What It ReturnsLesson 1925 — Reading Byte Arrays with read(byte[])
- Integration
- Reuse existing managed executors from frameworks
- Lesson 2864 — Passing Custom Executors to Async Methods
- Integrity
- Ensures objects maintain valid states throughout their lifetime
- Lesson 345 — Read-Only Properties: Getters Without Setters
- Intent is clear
- Signals you want to process *all* elements sequentially
- Lesson 173 — Iterating Arrays with Enhanced for Loops
- Intent over implementation
- Focus on *what* you're doing, not *how*
- Lesson 1429 — map with Method References
- Intentional patterns
- Silence "deprecation" when you must use a deprecated API temporarily
- Lesson 2414 — Built-In Annotations: When and Why to Use Each
- Interactive applications
- If you're writing a network protocol or chat application, you flush to send data promptly rather than waiting for the buffer to fill.
- Lesson 1957 — flush() and When to Use It
- Interactive output
- When writing prompts that users need to see before responding
- Lesson 1985 — flush: Forcing Buffer Contents to Disk
- interface
- in Java is a completely abstract type that defines a contract—a set of method signatures that any implementing class **must** provide.
- Lesson 487 — What Is an Interface? The Contract MetaphorLesson 495 — Interfaces vs Abstract Classes: Initial ComparisonLesson 913 — Bounded Type Parameters with InterfacesLesson 2376 — Exception Handling in Reflective InstantiationLesson 2498 — The Service Provider Interface (SPI) Pattern
- Interface implementation
- Documents that you're fulfilling a contract
- Lesson 2414 — Built-In Annotations: When and Why to Use Each
- Interfaces
- solve this by allowing a class to implement multiple contracts.
- Lesson 437 — is-a and Multiple Inheritance Through InterfacesLesson 495 — Interfaces vs Abstract Classes: Initial ComparisonLesson 513 — Default Methods and Abstract ClassesLesson 920 — What Are Multiple Bounds in Generics?Lesson 1946 — AutoCloseable and Closeable InterfacesLesson 2391 — Dynamic Proxies and AOP
- Interfaces (before default methods)
- couldn't do this.
- Lesson 528 — Evolution and Backward Compatibility Concerns
- Interfaces after
- Follow with interfaces, separated by `&`
- Lesson 921 — Syntax: Combining extends with &
- Intermediate gadgets
- Classes that transform or forward calls
- Lesson 2159 — Gadget Chains and Object Injection
- intermediate operation
- that returns a new sorted stream.
- Lesson 1360 — Sorting Streams with sorted(Comparator)Lesson 1419 — Understanding the filter OperationLesson 1455 — What is peek and Why It ExistsLesson 1460 — Common peek Pitfalls: Lazy EvaluationLesson 1463 — Understanding limit: Taking First N Elements
- Intermediate operations
- Transformations applied to the data (optional, can be chained)
- Lesson 1369 — The Stream Pipeline: Source, Intermediate, TerminalLesson 1393 — Understanding the Two Categories of Stream OperationsLesson 1401 — Identifying Operation Types in Real Code
- Internal HashMap.Entry overhead
- (hash code cache, next pointer for collision chains)
- Lesson 1055 — Memory Overhead: HashMap Values in HashSet
- Internal interfaces or contracts
- coordinate behavior within a package but aren't part of the public API
- Lesson 724 — Package-Private for Implementation Cohesion
- InternalError
- Something went critically wrong inside the JVM itself.
- Lesson 782 — VirtualMachineError and LinkageError: System-Level Errors
- Interoperability
- Algorithms work across different collection implementations.
- Lesson 967 — The Collections Framework: Purpose and Design
- Interpreted bytecode
- = reading the recipe and cooking step-by-step each time (slower, flexible)
- Lesson 25 — JIT Compilation: From Bytecode to Native Code at Runtime
- Interrupt handling
- ensures cleanup even if your waiting thread is interrupted
- Lesson 2775 — Common Shutdown Patterns and Best Practices
- Intersection
- uses the special `&&` operator to match only characters that appear in *both* sets.
- Lesson 2299 — Union and Intersection in Character Classes
- Invalid example (won't compile)
- Lesson 1340 — Type Safety in comparing(): Key Extractor Return Types
- IOException
- for other read failures → abort, alert the user
- Lesson 756 — The Need for Multiple catch Blocks
- IPv4
- uses four decimal numbers (0-255) separated by dots, like `192.
- Lesson 2287 — IP Address Patterns (IPv4 and IPv6)
- IPv6
- uses eight groups of four hexadecimal digits separated by colons, like `2001:0db8:85a3:0000:0000:8a2e:0370:7334`, with optional zero-compression (`::`).
- Lesson 2287 — IP Address Patterns (IPv4 and IPv6)
- ISO-8859-1
- Single-byte encoding for Western European languages
- Lesson 1997 — What Is Character Encoding?Lesson 2047 — Character Encoding with Charset Parameters
- Isolation
- Separate critical async tasks from general workload
- Lesson 2790 — Providing a Custom Executor to supplyAsync
- Isolation requirements
- Separate pools for different subsystems prevent one component from blocking another
- Lesson 2781 — Async Execution Models: Common vs Custom Executors
- It doesn't compose
- You can't chain further operations cleanly
- Lesson 1819 — Anti-Pattern: isPresent() Before get()
- It's procedural, not declarative
- You're telling the code *how* to check, not *what* to do with presence or absence
- Lesson 1819 — Anti-Pattern: isPresent() Before get()
- It's verbose
- More code to write and read than either null checks or functional alternatives
- Lesson 1819 — Anti-Pattern: isPresent() Before get()
- Iteration
- Lesson 1149 — Performance Characteristics of LinkedHashMapLesson 1258 — Singleton vs Single-Element List Performance
- Iteration bottlenecks
- Since you must manually synchronize iteration blocks, the collection stays locked for extended periods
- Lesson 1251 — Performance Implications of Synchronized Wrappers
- Iteration support
- – Ability to traverse all elements (via `Iterator<E> iterator()`)
- Lesson 968 — The Collection Interface: Core Contract
- Iterative version
- Lesson 232 — Converting Recursion to Iteration
J
- Jackson and JSON Serialization
- Lesson 2368 — Legitimate Use Cases: Frameworks and Serialization
- JAR file
- (Java ARchive) is a single compressed file that bundles multiple compiled `.
- Lesson 684 — What Is a JAR File?
- JAR hell
- Conflicting library versions on the classpath caused runtime failures that were difficult to diagnose.
- Lesson 2461 — Introduction to JPMS and the Module SystemLesson 2516 — Classpath Mechanics: How the JVM Finds Classes
- Java 11
- , the `isEmpty()` method was introduced as its logical inverse—it returns `true` when the `Optional` is **empty**, and `false` when it contains a value.
- Lesson 1772 — The isEmpty() Method (Java 11+)
- Java 17
- (and enhanced in later versions), switch expressions and enhanced switch statements allow you to explicitly handle `null` cases.
- Lesson 155 — Null Handling and Switch Behavior
- Java 6 changed this
- , recognizing that implementing an interface method is conceptually similar to overriding: you're providing a concrete implementation for an abstract contract.
- Lesson 2407 — @Override with Interfaces (Java 6+)
- Java 7
- , Oracle moved the intern pool to the **main heap**.
- Lesson 2182 — Intern Pool Location: PermGen vs Metaspace
- Java 7 and earlier
- , the String intern pool was stored in **PermGen** (Permanent Generation), a fixed-size memory area separate from the main heap.
- Lesson 2182 — Intern Pool Location: PermGen vs Metaspace
- Java 8
- , PermGen was completely eliminated and replaced with **Metaspace** (which stores class metadata only, not interned strings).
- Lesson 2182 — Intern Pool Location: PermGen vs Metaspace
- Java 9
- , if your resource variable is **effectively final** (never reassigned after initialization), you can reference it directly in the try-with-resources statement:
- Lesson 1949 — Effectively Final Resources (Java 9+)
- Java blocks this
- Lesson 709 — The 'Through Inheritance' Restriction
- Java Compiler
- is accessible.
- Lesson 7 — Verifying Your Installation with java -versionLesson 12 — Compiling with javacLesson 22 — javac vs java: The Compiler and Runtime Tools
- Java is different
- In Java, `boolean` is its own separate type with only two possible values: `true` and `false`.
- Lesson 55 — Common Mistakes: boolean vs Numeric Types
- JDK tool
- introduced with JPMS that creates **custom runtime images**.
- Lesson 2544 — What is jlink and Why Custom Runtime Images Matter
- JIT (Just-In-Time) Compilation
- is the JVM's clever performance optimization.
- Lesson 25 — JIT Compilation: From Bytecode to Native Code at Runtime
- JIT (Just-In-Time) compiler
- you learned about earlier.
- Lesson 103 — Performance and Compiler Optimizations
- JIT compiler limitations
- The JVM cannot inline reflective calls as aggressively
- Lesson 2395 — Performance Overhead of Reflection
- JIT-compiled native code
- = memorizing your most-ordered dish and cooking it automatically (faster, optimized)
- Lesson 25 — JIT Compilation: From Bytecode to Native Code at Runtime
- JIT-friendly
- The JVM can inline and optimize MethodHandle invocations far better than reflection.
- Lesson 2403 — MethodHandles as a Faster Alternative
- JRE (Java Runtime Environment)
- The Middle Layer
- Lesson 2 — JDK vs JRE vs JVM: The Three-Layer Architecture
- JSON
- (with libraries like Jackson or Gson) converts objects to readable text.
- Lesson 2165 — Alternatives to Java Serialization
- Just need a timestamp
- Use `Instant` for logging, database timestamps, or measuring duration between events.
- Lesson 1856 — Best Practices: When to Use ZonedDateTime
- Just-In-Time (JIT) compilation
- .
- Lesson 426 — final Methods and Performance MythsLesson 468 — Performance Implications of Dynamic Dispatch
- JVM (Java Virtual Machine)
- The Bottom Layer
- Lesson 2 — JDK vs JRE vs JVM: The Three-Layer Architecture
- JVM checks current method
- for a `try-catch` that surrounds the throw point
- Lesson 751 — The Search for a Handler
- JVM optimization level
- (JIT compilation improves both, but direct calls benefit more)
- Lesson 2398 — Method Invocation Overhead: invoke vs Direct Calls
K
- K largest elements
- Use a *min-heap* (natural ordering or min-comparator) of size K.
- Lesson 1191 — Using PriorityQueue for Top-K Problems
- K smallest elements
- Use a *max-heap* (reverse comparator) of size K.
- Lesson 1191 — Using PriorityQueue for Top-K Problems
- Keep `final`
- Accept shallow copying with shared references (often unacceptable)
- Lesson 569 — Final Fields and clone: The Conflict
- Keep capture minimal
- The fewer variables your lambda captures, the easier it is to understand and test.
- Lesson 1726 — Best Practices for Variable Capture
- Keep it the same
- when changes are **compatible**:
- Lesson 2130 — Best Practices for serialVersionUID Management
- Keep the first value
- Lesson 1520 — Handling Duplicate Keys in toMapLesson 1554 — toMap() with Merge Function: Resolving Conflicts
- Keep the last value
- Lesson 1520 — Handling Duplicate Keys in toMapLesson 1554 — toMap() with Merge Function: Resolving Conflicts
- Keep the maximum
- Lesson 1520 — Handling Duplicate Keys in toMap
- Keep-Alive Messages
- Lesson 2623 — Common Use Cases for Daemon Threads
- key
- in the backing `HashMap`, and the dummy `PRESENT` object becomes the **value**.
- Lesson 1049 — HashSet add: Calling HashMap putLesson 1106 — Bucket Contents: Linked List NodesLesson 1997 — What Is Character Encoding?
- Key `false`
- Maps to a `List<T>` containing all elements where the predicate returned `false`
- Lesson 1580 — The Map<Boolean, List<T>> Result Structure
- Key `true`
- Maps to a `List<T>` containing all elements where the predicate returned `true`
- Lesson 1580 — The Map<Boolean, List<T>> Result Structure
- Key behavior points
- Lesson 2858 — CompletableFuture.anyOf: Racing Multiple Futures
- Key characteristics
- Lesson 2854 — CompletableFuture.allOf: Waiting for All Tasks
- Key difference
- You need an actual object to call `getClass()`, whereas `.
- Lesson 383 — Obtaining Class Objects: .class and getClass()Lesson 1541 — Understanding findFirst and findAny Terminal OperationsLesson 2472 — Module Names and Naming Conventions
- Key improvements
- Lesson 2025 — Introduction to NIO.2 and the Path Interface
- Key performance costs
- Lesson 1251 — Performance Implications of Synchronized Wrappers
- Key-value collections
- `ArrayList<HashMap<String, Integer>>`
- Lesson 909 — Collections of Collections: Nested Generics
- key-value pairs
- , where each key maps to a specific value.
- Lesson 908 — HashSet<E> and HashMap<K,V>: Multiple Type ParametersLesson 997 — HashMap: Key- Value Pairs with Hashing
- keyMapper
- A `Function` that takes a stream element and returns its key
- Lesson 1519 — Collectors.toMap() with Key and Value MappersLesson 1552 — Collectors.toMap(): Basic Key-Value Mapping
- keys
- Lesson 908 — HashSet<E> and HashMap<K,V>: Multiple Type ParametersLesson 973 — Map Interface: Key-Value AssociationsLesson 1047 — HashSet as a HashMap Wrapper
- know
- you'll be adding approximately 1,000 elements, specifying that capacity upfront eliminates these expensive resize operations:
- Lesson 1003 — Specifying Initial Capacity ExplicitlyLesson 2294 — Possessive Quantifiers and Backtracking
- Kotlin
- chose a different path called **reified generics**, where type parameters remain available at runtime.
- Lesson 966 — Reified Generics in Other Languages: What Java Lacks
L
- Lack of Control
- You have no built-in way to limit thread count, queue pending tasks, or gracefully handle backpressure.
- Lesson 2709 — The Problem with Manual Thread Management
- Lack of JIT Optimizations
- The JIT compiler is brilliant at optimizing normal code—it can inline methods, eliminate dead code, and predict branches.
- Lesson 2397 — Why Reflection Is Slower Than Direct Access
- Lambda equivalent
- Lesson 652 — Lambda Conversions with Parameters and Return Values
- lambda expression
- , it refers to the enclosing class instance—the class that *contains* the lambda.
- Lesson 655 — this and super Semantics: Key DifferencesLesson 1420 — filter Syntax and Predicate ParameterLesson 2750 — Defining Callable Tasks with Lambda Expressions
- lambda expressions
- give you the power to define custom key extraction logic right on the spot.
- Lesson 1339 — Comparator.comparing() with Lambda ExpressionsLesson 1624 — Definition of a Functional InterfaceLesson 2564 — Lambda Expressions with Runnable
- Lambda's parameter type `x`
- = `Integer` (from target type `Function<Integer, String>`)
- Lesson 1733 — Target Typing with Generic Methods
- large arrays
- or data structures where memory truly matters—like processing image data or network packets where millions of values add up.
- Lesson 32 — Why int is the Default: Performance and CompatibilityLesson 36 — Choosing the Right Integer Type for Your Data
- Large buffers (128KB–1MB+)
- Fewer disk operations, potentially higher throughput for large files, but more memory per stream.
- Lesson 1952 — Buffer Size Selection and Throughput
- Large datasets
- Overhead makes it slower for small arrays (typically < ~8,000 elements)
- Lesson 1362 — Parallel Sorting with parallelSort()Lesson 1385 — parallelStream() for Parallel ProcessingLesson 1392 — Collection.stream() vs Arrays.stream() Performance Considerations
- Large directories
- When you need to process directories with many entries
- Lesson 2074 — DirectoryStream Interface Overview
- Large jumps
- between unbuffered and buffered?
- Lesson 1958 — Profiling I/O Performance: Identifying Bottlenecks
- Large offsets
- `skip(1000000)` touches a million elements
- Lesson 1469 — Performance Implications of skip
- Larger buffers
- Lesson 1981 — BufferedReader Buffer Size and Performance
- last
- parameter in the method signature
- Lesson 216 — Introduction to Varargs SyntaxLesson 1268 — Collections.indexOfSubList and lastIndexOfSubListLesson 1355 — Order of Operations: reversed() vs Null Methods
- Last digit extraction
- `number % 10` gives the rightmost digit
- Lesson 88 — The Modulus Operator: Finding Remainders
- lazily
- and **short-circuits** as soon as it finds a matching element.
- Lesson 1537 — noneMatch: Testing If No Elements MatchLesson 2041 — Streaming Lines: Files.lines for Memory-Efficient Reading
- Lazily evaluated
- The stream doesn't process anything until you invoke a terminal operation
- Lesson 1384 — stream() Method on Collections
- lazy
- .
- Lesson 1398 — Common Intermediate Operations: filter, map, flatMapLesson 1400 — Why No Result Without a Terminal OperationLesson 1419 — Understanding the filter OperationLesson 1480 — Understanding the Pipeline PatternLesson 2293 — Greedy vs Reluctant Quantifiers
- Lazy evaluation
- Operations can be optimized because the stream doesn't need to materialize all results immediately.
- Lesson 1367 — Streams Are Not Data StructuresLesson 1669 — Lazy Evaluation with Suppliers
- Lazy initialization
- – Create expensive objects only when needed
- Lesson 1665 — What is Supplier<T> and When to Use ItLesson 1747 — Constructor References with No Arguments
- Lazy loading
- Implementations are instantiated only when you iterate
- Lesson 2499 — The java.util.ServiceLoader ClassLesson 2504 — Loading Services with ServiceLoader.load()
- Leaderboard Systems
- Managing game scores where you need to find the next higher/lower score, or retrieve and remove the top score (`pollFirst()`).
- Lesson 1101 — TreeSet as NavigableSet: Practical Applications
- Leading delimiter
- Lesson 2209 — Handling Empty Strings and Edge Cases in split()
- Left rotation (negative distance)
- Elements near the front move to the end.
- Lesson 1234 — Collections.rotate: Shifting Elements Circularly
- Left side of arrow
- Parameter list—what the lambda receives
- Lesson 1699 — Lambda Expression Structure: Arrow Notation
- Legacy code compatibility
- When working with existing code that expects a `LinkedList` specifically, or when you need to pass the queue to methods accepting `List` parameters.
- Lesson 1180 — When to Use LinkedList as a Queue
- Legacy code integration
- Suppress "unchecked" or "rawtypes" warnings when interfacing with old APIs
- Lesson 2414 — Built-In Annotations: When and Why to Use Each
- Legacy code migration
- where many packages need reflection access during the transition to JPMS
- Lesson 2494 — Open Modules: Making All Packages Reflectively Accessible
- Legacy codebases
- with complex dependency graphs that would require extensive refactoring
- Lesson 2524 — Migration Strategy: When to Use Module Path vs Classpath
- Legacy libraries
- When third-party code requires `File` but you're using `Path`
- Lesson 2032 — Converting Between Path and File
- Legacy system compatibility
- – Interfacing with old systems requiring `float`
- Lesson 46 — When to Use double Over float
- Legitimate uses include
- Lesson 2373 — Invoking Private Constructors with setAccessible
- Lenient
- Legacy data migration with questionable dates
- Lesson 1893 — Case Sensitivity and Strict vs Lenient Parsing
- Less Boilerplate
- Omitting parameter types lets you focus on the logic rather than repetitive type declarations.
- Lesson 1717 — Type Inference Benefits and ReadabilityLesson 2719 — The Executors Factory Class Overview
- Less code
- No manual `close()`, no null checks
- Lesson 838 — Try-With-Resources vs Traditional Try-Finally
- Less readable
- Lesson 69 — Multiple Variable Declaration
- Less reusable code
- across different types
- Lesson 925 — Use Case: Combining Comparable and Serializable
- less than
- Is the left value smaller?
- Lesson 104 — Relational Operators: ==, !=, <, >, <=, >=Lesson 1313 — Return Values: Negative, Zero, Positive
- Less typing
- `count += 1` vs `count = count + 1`
- Lesson 129 — Assignment Operators: =, +=, -=, *=, /=, %=Lesson 859 — Diamond Operator: Type Inference in Constructors
- Let callers decide
- More restrictive bounds = fewer types can satisfy them = smaller audience for your code
- Lesson 927 — Common Pitfalls: Overly Restrictive Bounds
- Level-by-level traversal
- Processing data in waves or generations (breadth-first algorithms)
- Lesson 1218 — Stack vs Queue Trade-offs in Problem Solving
- Libraries and Tools
- Pre-written code that helps you accomplish common tasks (like working with text, numbers, or files) without starting from zero.
- Lesson 1 — What is the JDK and Why Do You Need It?
- Library maintenance
- Warn users before removing functionality in future versions
- Lesson 2414 — Built-In Annotations: When and Why to Use Each
- LIFO stack
- (use only operations at one end, like push/pop)
- Lesson 1193 — What Is a Deque? Double-Ended Queue Explained
- Lightweight
- Creating a thread is much faster and uses fewer resources than creating a new process.
- Lesson 2554 — Thread: A Lightweight Execution Unit
- Limit depth
- Use the `maxDepth` parameter to avoid traversing deeper than necessary
- Lesson 2093 — Performance and Resource Management in Walks
- Limitation
- `join` requires direct thread references.
- Lesson 2617 — join vs Other Synchronization: When to Use Each
- Limited scope
- Apply to the smallest code block necessary (method > class)
- Lesson 2414 — Built-In Annotations: When and Why to Use Each
- line number
- where the exception was thrown or propagated
- Lesson 747 — Stack Traces and Debugging Propagated ExceptionsLesson 753 — Stack Trace Information
- Line-by-line processing
- with `readLine()`
- Lesson 1986 — Complete Example: Reading and Writing Text Files
- linked list
- structure.
- Lesson 1113 — What Happens When Two Keys Hash to the Same BucketLesson 1115 — Tree Bins: The Java 8 OptimizationLesson 1118 — Comparable Keys and Tree Ordering
- LinkedHashMap
- When you want to preserve the order keys were first encountered
- Lesson 1577 — Custom Map Types with groupingBy Supplier
- LinkedHashMap (insertion order)
- Lesson 1521 — Specifying the Map Implementation with toMap
- LinkedHashMap/LinkedHashSet
- Any structural modification
- Lesson 1304 — Fail-Fast in HashMap and Other Collections
- LinkedHashSet
- , elements appear in exactly the order you inserted them—no exceptions.
- Lesson 1080 — Iterating LinkedHashSetLesson 1083 — Choosing Between HashSet and LinkedHashSet
- LinkedList
- uses nodes connected by references—efficient for adding/removing elements at both ends, but slower for accessing elements by index.
- Lesson 907 — LinkedList<E> and Other Generic List ImplementationsLesson 1028 — Memory Overhead of NodesLesson 1037 — Time Complexity: ArrayList vs LinkedList for AccessLesson 1038 — Time Complexity: Insertion at BeginningLesson 1040 — Time Complexity: Insertion in MiddleLesson 1042 — Memory Overhead: ArrayList Capacity vs LinkedList NodesLesson 1209 — ArrayDeque vs LinkedList: When to Use WhichLesson 1518 — Collectors.toCollection() for Specific Collection Types
- LinkedList suffers here
- Each node is a separate object allocated somewhere in the heap—potentially far from the previous and next nodes.
- Lesson 1043 — Cache Locality and Performance Impact
- LinkedList's Iterator
- `LinkedList` must follow node references (pointers) to traverse from one element to the next.
- Lesson 1044 — Iteration Performance: Sequential Access Patterns
- Linux
- Often uses a different priority scheme entirely, and thread priorities may have minimal effect depending on the scheduler policy.
- Lesson 2629 — Platform-Dependent Priority Mapping
- List collection
- Lesson 1502 — Comparing toArray() with collect(toList())
- Listener registrations
- Lesson 301 — Memory Leaks in Java
- livelock
- keeps threads actively running but making zero progress.
- Lesson 2700 — What Is Livelock?Lesson 2701 — Classic Livelock Example: The Hallway ProblemLesson 2703 — Detecting Livelock vs DeadlockLesson 2705 — What Is Starvation?
- load factor
- (default 0.
- Lesson 987 — Size and Memory Considerations in Collection ChoiceLesson 1054 — Initial Capacity and Load Factor in HashSetLesson 1057 — What Is Load Factor in HashSet?Lesson 1123 — Understanding Load Factor: Capacity vs SizeLesson 1125 — When Rehashing Occurs: The Threshold Calculation
- local class
- is a class declared *inside* a method, constructor, or any block of code (like an if-statement or loop).
- Lesson 632 — What Are Local Classes?Lesson 633 — Declaring and Instantiating Local ClassesLesson 634 — Accessing Local Variables from Local ClassesLesson 638 — Local Classes vs Anonymous Classes
- Local context
- Variable values, IDs, states relevant to the current method
- Lesson 773 — Logging and Rethrowing: Best Practices
- Local variables
- (declared inside methods) do *not* — you must assign them a value before use, or the compiler will reject your code.
- Lesson 67 — Default Values for Fields vs Local VariablesLesson 74 — Naming Conventions for final Variables
- Local variables and parameters
- (closest scope)
- Lesson 629 — Shadowing and Name Resolution in Inner Classes
- Local variables get nothing
- If you declare an `int` inside a method and try to use it without assigning a value, the compiler throws an error: *"variable might not have been initialized.
- Lesson 67 — Default Values for Fields vs Local Variables
- LocalDateTime
- offer similar methods for hours, minutes, seconds, and nanoseconds.
- Lesson 1844 — with Methods: Replacing Specific Fields
- LocalTime
- and **LocalDateTime** offer similar methods for hours, minutes, seconds, and nanoseconds.
- Lesson 1844 — with Methods: Replacing Specific Fields
- Location marker
- The `^` symbol points to where the compiler got confused
- Lesson 14 — Understanding Compilation Errors
- Lock acquisition overhead
- Every operation pays the cost of claiming and releasing a lock, even simple reads
- Lesson 1251 — Performance Implications of Synchronized Wrappers
- Lock acquisition/release
- adds overhead to every single method call
- Lesson 1032 — Vector's Synchronization Mechanism
- Lock ordering complexity
- Enforcing a consistent lock acquisition order across many resources and code paths becomes much harder to verify.
- Lesson 2694 — Deadlock with Multiple Threads and Resources
- Lock scope
- is how much code executes while holding a lock.
- Lesson 2699 — Avoiding Nested Locks and Minimizing Lock Scope
- Locks and synchronization
- Release locks so other threads can proceed.
- Lesson 734 — Common finally Use Cases: Resource Cleanup
- Log Entry Parsing
- Lesson 2272 — Practical Use Cases: Parsing Structured Text
- Log suppressed exceptions explicitly
- Don't rely on default exception output.
- Lesson 847 — Best Practices for Suppressed Exceptions
- Logging
- Record the exception before it moves up
- Lesson 745 — Re-throwing Exceptions After Partial HandlingLesson 2625 — Checking Daemon Status
- Logging with context
- Lesson 1677 — BiConsumer<T, U>: Two Inputs, No Return
- Logical AND
- `&&` — both conditions must be true
- Lesson 112 — Chaining Comparisons and Operator Precedence
- Logical cohesion
- When a class is meaningless outside its parent context, nesting signals this relationship immediately to readers.
- Lesson 621 — Common Use Cases and Best Practices
- Logical Equality (`equals()`)
- Checks if two objects are *meaningfully equivalent*—like asking "Do these two boxes contain the same thing?
- Lesson 541 — The equals Method: Reference vs Logical Equality
- Logical grouping
- When a class is conceptually part of another class but doesn't need access to its instance data, nest it statically.
- Lesson 618 — Organizing Related Classes with Static Nested Classes
- Logical operators
- (`&&`, `||`) work exclusively with **boolean expressions**
- Lesson 122 — Bitwise vs Logical Operators: & vs &&, | vs ||
- Logical OR
- `||` — at least one condition must be true
- Lesson 112 — Chaining Comparisons and Operator Precedence
- Logical organization
- Model real-world relationships
- Lesson 393 — What Is Inheritance? The extends Keyword
- Logical XOR
- `^` — exactly one condition must be true
- Lesson 112 — Chaining Comparisons and Operator Precedence
- Lombok
- Generates getters, setters, constructors from annotations
- Lesson 2452 — What Are Annotation Processors?Lesson 2459 — Common Use Cases: Lombok, AutoValue, and Dagger
- Long critical sections
- If some threads hold locks for extended periods, others may wait forever
- Lesson 2705 — What Is Starvation?
- Long iterations
- Manual synchronization blocks all other access during traversal
- Lesson 1251 — Performance Implications of Synchronized Wrappers
- Long-running operations
- (I/O, network calls, heavy computation)
- Lesson 2660 — When to Use Synchronized Methods
- Long-running streams
- Periodically flush to prevent data loss if the program crashes
- Lesson 1931 — Flushing Output StreamsLesson 1938 — close vs flush: Automatic Flushing on Close
- Long-running tasks
- You need dedicated threads that won't monopolize the common pool
- Lesson 2781 — Async Execution Models: Common vs Custom ExecutorsLesson 2790 — Providing a Custom Executor to supplyAsync
- Long-term persistence
- Serialization breaks when you change class definitions.
- Lesson 2111 — When to Use and Avoid Serialization
- Look for patterns
- missing semicolons and typos are most common at first
- Lesson 14 — Understanding Compilation Errors
- Looking up with alice2
- `HashMap` calls `alice2.
- Lesson 557 — Demonstrating the Bug: A Step-by-Step Example
- Lookup reliability
- `contains()` finds equal objects even if they're different instances
- Lesson 1093 — Testing Your equals and hashCode Implementations
- Loop body
- – Runs if the condition was `true`
- Lesson 166 — Executing for Loops: Step-by-Step Evaluation Order
- Lost updates
- One thread's changes overwrite another's
- Lesson 1247 — Why Collections Need Synchronization
- Lower load factor
- (e.
- Lesson 1057 — What Is Load Factor in HashSet?Lesson 1065 — Choosing Load Factor: Space vs Time Trade-offsLesson 1123 — Understanding Load Factor: Capacity vs Size
- LRU Caches
- An LRU (Least Recently Used) cache needs to track which items were accessed most recently.
- Lesson 1081 — Use Cases for Insertion OrderLesson 1145 — Access Order Mode: The accessOrder ParameterLesson 1151 — When to Use LinkedHashMap vs HashMap
M
- Magnitude
- Values outside the smaller type's range wrap around unpredictably.
- Lesson 78 — Narrowing Conversions: Potential Data Loss
- Main class
- (if one was specified when creating the JAR)
- Lesson 2510 — Inspecting Modular JAR Contents with jar --describe-module
- Main-Class
- Specifies which class contains the `main` method to run when you execute the JAR:
- Lesson 686 — The JAR Manifest File
- Maintain backward compatibility
- by keeping old fields (perhaps as `transient` or deprecated)
- Lesson 2164 — Versioning Problems and Class Evolution
- Maintain proper interrupt semantics
- across your application
- Lesson 2598 — Restoring Interrupt Status in catch Blocks
- Maintainability
- Eliminate potential `ClassCastException` failures and `instanceof` checks.
- Lesson 475 — Practical Benefits: Avoiding DowncastsLesson 1425 — Chaining Multiple filter OperationsLesson 2234 — What Are Text Blocks?Lesson 2281 — Named Groups and Pattern Maintainability
- Maintaining Processing Order
- Imagine you're collecting user actions in a web application.
- Lesson 1081 — Use Cases for Insertion Order
- Maintaining user input order
- Processing configuration or form data in sequence
- Lesson 1151 — When to Use LinkedHashMap vs HashMap
- Maintains
- a fixed number of threads (the pool size)
- Lesson 2712 — Thread Pools: Reusing Threads for Efficiency
- Maintenance
- Code reviews and build systems can track deprecation warnings as technical debt
- Lesson 2409 — @Deprecated: Compiler Warnings
- Maintenance burden
- Debugging code mixed with business logic creates confusion.
- Lesson 1462 — Removing peek in Production CodeLesson 1755 — Traditional null Checking: Verbose and Error-ProneLesson 2552 — Comparing jlink Images to Traditional Deployments
- Maintenance errors
- when superclass signatures change
- Lesson 423 — Best Practices: Always Use @Override
- Maintenance nightmare
- Developers can't tell which JAR owns which classes in a package.
- Lesson 2522 — Split Packages: The Problem JPMS Solves
- Maintenance nightmares
- Code relying on internal implementation details breaks when classes evolve
- Lesson 2360 — Performance and Security Implications of Field Access
- Make `public` deliberately
- Only expose what's part of your class's intended interface
- Lesson 337 — The Principle of Least Privilege
- Make close() methods robust
- When implementing `AutoCloseable`, ensure your `close()` method never throws unless absolutely necessary.
- Lesson 847 — Best Practices for Suppressed Exceptions
- Make debugging easier
- (fewer places to check when things go wrong)
- Lesson 722 — Default to Most Restrictive: The Principle of Least Privilege
- Make variables immediately usable
- (no need to remember to initialize later)
- Lesson 68 — Declaration and Initialization in One Statement
- Making fields transient
- The field is ignored during serialization going forward
- Lesson 2164 — Versioning Problems and Class Evolution
- Malformed input
- You're reading bytes that don't form valid characters in the declared encoding (e.
- Lesson 2006 — Encoding Errors and Replacement Characters
- Management Complexity
- Tracking thread lifecycles becomes nightmarish.
- Lesson 2709 — The Problem with Manual Thread Management
- Manifest syntax
- Lesson 687 — Executable JARs and the Main-Class Attribute
- Manual normalization
- happens only for the `normalized()` method, which converts excess months to years:
- Lesson 1864 — Period Arithmetic and Normalization
- Many competing threads
- Contention skyrockets as more threads fight for the single lock
- Lesson 1251 — Performance Implications of Synchronized Wrappers
- Map your dependency graph
- to identify leaf modules (libraries with no internal dependencies)
- Lesson 2526 — The Bottom-Up Migration Strategy
- Marker behavior
- You need a type flag with no methods at all
- Lesson 532 — Decision Criteria: A Practical Checklist
- marker interface
- is an interface with no methods or constants—it exists purely to tag a type with a capability or characteristic.
- Lesson 530 — Marker Interfaces vs Empty Abstract ClassesLesson 561 — The Cloneable Interface and Object.cloneLesson 2104 — The Serializable Marker Interface
- Massive arrays
- – Storing millions of values where memory is tight
- Lesson 46 — When to Use double Over float
- Match parameter count
- from the functional interface method
- Lesson 1752 — Constructor Overloading Resolution
- Match parameter types
- (exact match or compatible through widening/boxing)
- Lesson 1752 — Constructor Overloading Resolution
- Matcher
- applies that compiled pattern to a particular input sequence (a `CharSequence`, which includes `String`).
- Lesson 2244 — Introduction to Pattern and Matcher
- Maximum value
- 2,147,483,647 (about +2.
- Lesson 26 — The int Type: Java's Default IntegerLesson 28 — The long Type: Extended Range Integers
- MEDIUM
- Balanced detail (e.
- Lesson 1892 — Localized Formatting with ofLocalizedDate and ofLocalizedTime
- Medium buffers (8KB–64KB)
- Good balance between performance and memory usage.
- Lesson 1952 — Buffer Size Selection and Throughput
- Memory
- Singleton collections use significantly less memory because they don't pre-allocate array space.
- Lesson 1258 — Singleton vs Single-Element List Performance
- memory addresses
- stored in the reference variables, not the actual data inside the objects.
- Lesson 286 — Reference Equality with ==: Comparing Memory AddressesLesson 287 — Why == Fails for String Comparison
- Memory allocation
- `new` allocates space on the heap for the new object
- Lesson 313 — Creating Objects: Using new with ConstructorsLesson 1613 — Performance Benefits of teeing Over Multiple Passes
- Memory buffers
- Writes may be buffered before reaching main memory
- Lesson 2680 — The Visibility Problem: Why volatile Exists
- memory constraints
- and can tolerate slightly slower lookups, a higher load factor reduces wasted space.
- Lesson 1130 — Custom Load Factor: When and Why to Change ItLesson 1952 — Buffer Size Selection and ThroughputLesson 2074 — DirectoryStream Interface Overview
- Memory consumption
- If you call `distinct()` on a stream of 1 million elements, the operation might store up to 1 million unique values in memory.
- Lesson 1447 — The Stateful Nature of distinct
- Memory efficiency
- Growing by 1.
- Lesson 1007 — The Growth Strategy: 1.5x ExpansionLesson 1214 — ArrayDeque as a Stack: Implementation ChoiceLesson 1409 — No Intermediate Storage
- Memory efficiency matters
- (no extra pointers to track order)
- Lesson 1083 — Choosing Between HashSet and LinkedHashSet
- Memory leaks
- Buffers and internal data structures tied to resources consume heap space indefinitely.
- Lesson 848 — The Problem of Resource LeaksLesson 1911 — The close() Method and Stream LifecycleLesson 2184 — Common Use Cases and Anti-patterns
- Memory locality
- Elements sit consecutively in memory, making the CPU cache very happy
- Lesson 1227 — Performance Characteristics of Sorting
- Memory matters
- Timsort requires **O(n)** extra space for merging.
- Lesson 1364 — Sorting Performance Considerations
- Memory Overhead
- Lesson 1149 — Performance Characteristics of LinkedHashMapLesson 1305 — What Is Fail-Safe Behavior?Lesson 1388 — IntStream, LongStream, DoubleStream from Primitive Arrays
- Memory pressure
- Buffers remain allocated even when you're done
- Lesson 1942 — Why Closing Streams Matters: Resource Leaks Explained
- Memory tuning
- Use heap size parameters, not PermGen settings
- Lesson 2182 — Intern Pool Location: PermGen vs Metaspace
- memory usage
- and **performance**:
- Lesson 1935 — Default Buffer Size: 8KB ExplainedLesson 2441 — Retention Policy and Performance Implications
- Memory used
- for any intermediate results you create manually
- Lesson 1410 — Contrasting Eager Collection Operations
- merge function
- that tells Java how to combine conflicting values.
- Lesson 1520 — Handling Duplicate Keys in toMapLesson 1554 — toMap() with Merge Function: Resolving Conflicts
- Merge sort
- Split the array, sort each half recursively, merge results
- Lesson 233 — When to Use Recursion: Tree Traversal and Divide-and-Conquer
- Merger function
- – combines both results into a final output
- Lesson 1609 — Basic teeing Example: Min and Max in One Pass
- Message
- Explain the specific problem in human-readable form
- Lesson 816 — Constructors: Message, Cause, and Both
- MessagePack
- and **Avro** provide compact binary formats with schema support.
- Lesson 2165 — Alternatives to Java Serialization
- Metaspace
- (which stores class metadata only, not interned strings).
- Lesson 2182 — Intern Pool Location: PermGen vs Metaspace
- method calls
- Lesson 413 — Common Pitfalls with super in ConstructorsLesson 1784 — Choosing Between orElse and orElseGet
- Method complexity
- (simple getters show bigger relative differences)
- Lesson 2398 — Method Invocation Overhead: invoke vs Direct Calls
- Method level
- Suppresses warnings for the entire method
- Lesson 2413 — @SuppressWarnings: Scope and Best Practices
- Method Lookup
- Every reflective call requires the JVM to look up which method to invoke by matching method names and parameter types at runtime.
- Lesson 2397 — Why Reflection Is Slower Than Direct Access
- Method lookup overhead
- – finding the right constructor through metadata
- Lesson 2378 — Performance and Security Considerations
- method name
- where execution was happening
- Lesson 753 — Stack Trace InformationLesson 2140 — The writeObject Method Signature
- Method overriding
- lets the subclass provide its own implementation of an inherited method while keeping the same method signature (name, parameters, and return type).
- Lesson 414 — What Is Method Overriding?
- method reference
- is shorthand for a lambda that simply delegates to an existing method.
- Lesson 654 — Method References as Further SimplificationLesson 1420 — filter Syntax and Predicate ParameterLesson 1429 — map with Method ReferencesLesson 2750 — Defining Callable Tasks with Lambda Expressions
- Method reference (when applicable)
- Lesson 2807 — thenAccept Signature and Lambda Usage
- method references
- instead, making your code even more concise and expressive.
- Lesson 1343 — thenComparing() with Method ReferencesLesson 1422 — Method References in filterLesson 1491 — forEach with Method ReferencesLesson 1589 — Using summingInt with Method ReferencesLesson 1624 — Definition of a Functional InterfaceLesson 1663 — Method References as ConsumersLesson 1668 — Method References as SuppliersLesson 1793 — Using Method References with ifPresent
- Method resolution
- Finding the actual method implementation adds indirection
- Lesson 2350 — Performance Costs of Reflective Invocation
- method signature
- is the unique identifier Java uses for this purpose.
- Lesson 206 — What Is a Method Signature?Lesson 2163 — The readResolve Method for Singleton ProtectionLesson 2403 — MethodHandles as a Faster Alternative
- Method-level locking isn't enough
- Synchronizing individual methods doesn't make compound operations (like "check-then-add") thread-safe.
- Lesson 1030 — What Is Vector: A Legacy Synchronized List
- Method-level type parameters
- are declared on individual methods and exist only within that specific method's scope.
- Lesson 862 — Type Parameter Scope: Class-Level vs Method-Level
- Migration cost outweighs benefits
- for stable, working applications nearing end-of-life
- Lesson 2524 — Migration Strategy: When to Use Module Path vs Classpath
- Migration guidance
- Use `since` and `forRemoval` to communicate timelines
- Lesson 2414 — Built-In Annotations: When and Why to Use Each
- Millisecond + Nanosecond precision
- Lesson 2591 — Thread.sleep Syntax and Time Units
- Millisecond-based sleep
- Lesson 2591 — Thread.sleep Syntax and Time Units
- Minimal code
- Just implement the marker interface
- Lesson 2157 — Externalizable vs Serializable: Trade-offs and Decision Guide
- Minimal cross-package access
- within your application
- Lesson 2525 — Assessing Your Application's Readiness for Modules
- Minimize public classes
- Every `public` class is a commitment.
- Lesson 712 — Cross-Package Access Patterns and Best Practices
- Minimize reallocations
- – Grow aggressively to avoid frequent copies
- Lesson 1010 — Memory Implications of Capacity Management
- Minimize scope
- Convert once at integration points, not scattered throughout code
- Lesson 1902 — Interoperating with Legacy APIs
- Minimize wasted space
- – Keep capacity close to actual size
- Lesson 1010 — Memory Implications of Capacity Management
- Minimum value
- 2,147,483,648 (about -2.
- Lesson 26 — The int Type: Java's Default IntegerLesson 28 — The long Type: Extended Range Integers
- Minute and Second
- Lesson 1890 — Pattern Symbols: Time Components (H, h, m, s, S, n, a)
- Mismatched braces
- Lesson 14 — Understanding Compilation Errors
- Missing `serialVersionUID`
- One version of your class had an explicit `serialVersionUID`, but the other doesn't (or uses the default computed value)
- Lesson 2125 — InvalidClassException: Version Mismatch Errors
- Missing Base Case
- Lesson 230 — Stack Overflow Error: When Recursion Goes Too Deep
- Missing JAR files
- You forgot to include a required JAR in your classpath.
- Lesson 693 — Common Classpath Issues and ClassNotFoundException
- Missing semicolon
- Lesson 14 — Understanding Compilation Errors
- Misspelled keywords or methods
- Lesson 14 — Understanding Compilation Errors
- Mitigation strategy
- Cache your reflection objects after calling `setAccessible` once, rather than obtaining and configuring them repeatedly.
- Lesson 2400 — setAccessible and Security Manager Overhead
- Mixed workloads
- Reads remain fast even while writes are happening, thanks to non-blocking read operations.
- Lesson 1165 — Performance Characteristics: Read vs Write Operations
- Modern alternatives
- Lesson 977 — Legacy Collection Classes: Vector and Hashtable
- Modern API design
- Uses interfaces and utility methods following current Java best practices
- Lesson 2025 — Introduction to NIO.2 and the Path Interface
- Modern design
- `ArrayDeque` implements the `Deque` interface, giving you flexibility.
- Lesson 1214 — ArrayDeque as a Stack: Implementation ChoiceLesson 2034 — Overview of Files Utility Class and Basic Operations
- Modern hardware
- – Today's processors handle `double` efficiently
- Lesson 46 — When to Use double Over float
- Modern replacement
- Use `try-with-resources` for `AutoCloseable` resources, or explicit `close()` methods with try- finally blocks.
- Lesson 577 — Deprecation of finalize in Java 9+
- Modern shortcut
- You can skip Step 1 entirely—`instanceof` handles it!
- Lesson 543 — Implementing equals: The Step-by-Step Recipe
- modification count
- .
- Lesson 1290 — ConcurrentModificationException with ListIteratorLesson 1300 — What Is Fail-Fast Behavior?
- Modifier
- | **Same Class** | **Same Package** | **Subclass** | **Everywhere** |
- Lesson 335 — Comparing Access Levels: A Decision Matrix
- modify
- array elements (change their values)
- Lesson 249 — When to Use Indexed vs Enhanced for LoopsLesson 2644 — Why count++ Is Not AtomicLesson 2685 — volatile Does Not Provide Atomicity for Compound Actions
- Modify inside the loop
- Update the variable so the condition eventually becomes false
- Lesson 158 — Loop Control Variables and Counting Patterns
- Modifying class hierarchy
- (adding/removing `Serializable` superclasses)
- Lesson 2164 — Versioning Problems and Class Evolution
- Modifying the list structure
- (removing elements safely)
- Lesson 1296 — Enhanced For Loop vs Traditional For Loop
- modular JAR
- is simply a JAR file that contains a compiled `module-info.
- Lesson 2508 — What Are Modular JARs?Lesson 2509 — Creating a Modular JAR with javac and jar
- Modular JAR on classpath
- Module descriptor is ignored; treated as non-modular
- Lesson 2515 — Modular JARs vs Non-Modular JARs at Runtime
- Modular JARs
- – already JPMS-ready, easiest to work with
- Lesson 2525 — Assessing Your Application's Readiness for Modules
- Module accessibility validation
- (checking module exports/opens)
- Lesson 2400 — setAccessible and Security Manager Overhead
- Module dependencies
- (all `requires` directives)
- Lesson 2510 — Inspecting Modular JAR Contents with jar --describe-module
- Module name
- (your module's identity)
- Lesson 2508 — What Are Modular JARs?Lesson 2510 — Inspecting Modular JAR Contents with jar -- describe-module
- Module name derived
- From the JAR filename (or `Automatic-Module-Name` in MANIFEST.
- Lesson 2515 — Modular JARs vs Non-Modular JARs at Runtime
- Module name generation
- The system derives a module name from the JAR filename (stripping version numbers and normalizing characters)
- Lesson 2536 — How JARs Become Automatic Modules
- module path
- , and you specify the starting module and main class using the `--module` flag.
- Lesson 2467 — Running a Modular Application with javaLesson 2514 — Modular JARs on the Module PathLesson 2515 — Modular JARs vs Non-Modular JARs at RuntimeLesson 2517 — Module Path Introduction: A New Way to Organize CodeLesson 2519 — Mixing Module Path and Classpath: Compatibility ModeLesson 2520 — Class Loading Differences: Modules vs ClasspathLesson 2521 — Encapsulation Enforcement on Module PathLesson 2522 — Split Packages: The Problem JPMS Solves (+2 more)
- Module-aware
- Respects JPMS visibility and `provides` declarations
- Lesson 2499 — The java.util.ServiceLoader ClassLesson 2520 — Class Loading Differences: Modules vs Classpath
- modules
- .
- Lesson 2450 — ElementType.PACKAGE and MODULELesson 2461 — Introduction to JPMS and the Module SystemLesson 2466 — Compiling a Module with javac
- Modulus (%)
- Returns the *remainder* after division.
- Lesson 86 — The Five Basic Arithmetic Operators: +, -, *, /, %
- mojibake
- (garbled characters) or data loss.
- Lesson 1976 — When to Avoid FileReader/FileWriter: Encoding IssuesLesson 1997 — What Is Character Encoding?Lesson 2005 — Default Charset and Platform Dependency
- monitor
- ) built into it.
- Lesson 2653 — The Implicit Lock (Monitor) of an ObjectLesson 2662 — Intrinsic Locks and Monitor Objects
- Monitor large trees
- Walking millions of files can be slow and memory-intensive
- Lesson 2093 — Performance and Resource Management in Walks
- Monitor upstream projects
- Many libraries are actively adding module support
- Lesson 2543 — Migration Strategy: From Automatic to Explicit Modules
- Monitoring
- Track resource usage per task category
- Lesson 2790 — Providing a Custom Executor to supplyAsync
- Monitoring and Health Checks
- Lesson 2623 — Common Use Cases for Daemon Threads
- Monolithic JDK
- The entire Java runtime library loaded regardless of what you actually needed, making Java too heavyweight for modern applications.
- Lesson 2461 — Introduction to JPMS and the Module System
- More memory waste
- if you don't fill the vector completely
- Lesson 1033 — Vector Growth Strategy: Doubling Capacity
- More memory-efficient
- (uses far less space)
- Lesson 597 — Introduction to EnumSet: A Specialized Set for Enums
- More readable
- Lesson 69 — Multiple Variable DeclarationLesson 638 — Local Classes vs Anonymous Classes
- More responsibility
- Must implement `writeExternal`/`readExternal` correctly
- Lesson 2157 — Externalizable vs Serializable: Trade-offs and Decision Guide
- More specific
- means:
- Lesson 212 — The Most Specific Method RuleLesson 472 — Covariant Returns with Classes
- Most of the time
- , this is a single assignment operation—genuinely O(1).
- Lesson 1039 — Time Complexity: Insertion at End
- most specific
- (lowest in the hierarchy) implementation.
- Lesson 464 — Method Overriding and the Most Specific ImplementationLesson 571 — The getClass Method: Runtime Type InformationLesson 1752 — Constructor Overloading Resolution
- Most Specific Interface Wins
- Lesson 511 — The Diamond Problem and Resolution Rules
- most specific method
- rule you already know, but varargs are considered *less specific* than fixed-parameter methods.
- Lesson 220 — Method Overloading with VarargsLesson 1732 — Ambiguity and Overload Resolution
- Move pointers inward
- increment start, decrement end
- Lesson 1230 — Reverse Internals: How Swapping Works
- Move up one level
- to modules that depend only on your newly modularized leaves
- Lesson 2526 — The Bottom-Up Migration Strategy
- Multi-catch (reassignment NOT allowed)
- Lesson 763 — The Implicit final in Multi-Catch
- Multi-core systems
- You need multiple CPU cores to benefit
- Lesson 1362 — Parallel Sorting with parallelSort()
- Multi-level transformations
- downstream collectors that process grouped data further
- Lesson 1522 — Why collect Is the Gateway to Advanced Collectors
- Multi-source queries
- Querying multiple databases where each contains part of the answer
- Lesson 2767 — Use Cases: invokeAll vs invokeAny
- Multiple capabilities
- A class can implement `Serializable` *and* many other interfaces without conflict.
- Lesson 530 — Marker Interfaces vs Empty Abstract Classes
- Multiple implementations
- `ServiceLoader` can discover zero, one, or many implementations
- Lesson 2500 — The 'uses' Directive in module-info.java
- Multiple inheritance required
- A class must fulfill multiple contracts (e.
- Lesson 532 — Decision Criteria: A Practical Checklist
- Multiple Interface Implementations
- Lesson 653 — When Lambda Conversion Is Not Possible
- multiple methods
- or complex logic
- Lesson 638 — Local Classes vs Anonymous ClassesLesson 653 — When Lambda Conversion Is Not Possible
- Multiple methods needed
- The interface has more than one abstract method
- Lesson 649 — When to Prefer Lambdas Over Anonymous Classes
- Multiple Providers
- If multiple modules provide the same service, you'll get all of them.
- Lesson 2504 — Loading Services with ServiceLoader.load()
- Multiple readers
- Can always read without blocking (using volatile reads)
- Lesson 1160 — ConcurrentHashMap Overview: Lock Striping Architecture
- multiple resources
- in a single try-with-resources statement by separating them with semicolons.
- Lesson 831 — Multiple Resources in Try-With-ResourcesLesson 1947 — Multiple Resources in Try-With- Resources
- Multiple Similar Parameters
- When parameters have similar roles, explicit types clarify which is which.
- Lesson 1717 — Type Inference Benefits and Readability
- multiple statements
- Lesson 373 — Static Blocks vs Static Field InitializersLesson 1650 — Creating Function Instances with Lambdas
- Multiple threads
- will access the same collection instance
- Lesson 1247 — Why Collections Need Synchronization
- Multiple threads, high contention
- → Migrate to `ConcurrentHashMap`
- Lesson 1158 — Migrating from Hashtable to Modern Alternatives
- Multiple writers
- Can modify different segments simultaneously
- Lesson 1160 — ConcurrentHashMap Overview: Lock Striping Architecture
- must
- save this file as `HelloWorld.
- Lesson 18 — Source File and Class Name MatchingLesson 70 — The final Keyword for VariablesLesson 71 — final and Initialization RequirementsLesson 151 — Exhaustiveness in Switch ExpressionsLesson 195 — Return Types: void vs Value-Returning MethodsLesson 199 — Multiple Parameters and Parameter OrderLesson 311 — Constructor Syntax: Name and ParametersLesson 487 — What Is an Interface? The Contract Metaphor (+51 more)
- must override
- the `equals` method.
- Lesson 288 — The equals Method: Defining Object EqualityLesson 499 — Conflicting Default Methods
- Mutability
- Both `Date` and `Calendar` objects were mutable, meaning their values could be changed after creation.
- Lesson 1895 — Problems with java.util.Date and java.util.CalendarLesson 1899 — Replacing Calendar Arithmetic with Period and Duration
- mutable
- character sequence designed specifically for building strings efficiently.
- Lesson 538 — StringBuilder for Efficient toString ImplementationsLesson 2186 — StringBuilder: The Non- Synchronized Choice
- mutual exclusion
- only one thread can execute the critical section at a time.
- Lesson 2670 — Visibility Guarantees of Synchronized BlocksLesson 2683 — volatile vs synchronized: When to Use Each
N
- N operations
- (the adds) + **log N operations** (the resizes that each copy O(n) elements) = **O(N) total work**
- Lesson 1017 — Counting Operations: N Adds and Log N Resizes
- name
- you choose.
- Lesson 65 — Variable Declaration SyntaxLesson 306 — Fields: Instance Variables in a ClassLesson 908 — HashSet<E> and HashMap<K,V>: Multiple Type ParametersLesson 2124 — Declaring an Explicit serialVersionUID
- Name Conflicts
- When two classes have the same simple name (e.
- Lesson 678 — When to Use FQNs vs Import Statements
- Name threads
- Simplify debugging and monitoring
- Lesson 2866 — Why Custom Executors Matter: Isolation and Resource Control
- named groups
- when readability and maintenance matter more than typing a few extra characters.
- Lesson 2275 — Named Groups vs Numbered GroupsLesson 2277 — Backreferences to Named Groups
- Namespace management
- Instead of creating `HashMap` and `HashMapEntry` as separate top-level classes, Java uses `HashMap.
- Lesson 618 — Organizing Related Classes with Static Nested ClassesLesson 621 — Common Use Cases and Best Practices
- Namespace organization
- You want to group related classes under a single name (e.
- Lesson 619 — Static Nested Classes vs Top-Level Classes
- Naming Patterns for Properties
- Lesson 342 — JavaBeans Naming Conventions Overview
- NaN
- (Not-a-Number): Represents an undefined or unrepresentable result (like `0.
- Lesson 44 — Special Values: Infinity, -Infinity, and NaN
- Nanosecond precision
- You can even add nanoseconds as a second argument:
- Lesson 1828 — Creating Instants: now() and ofEpochSecond()
- Nanoseconds
- for sub-second precision (0 to 999,999,999)
- Lesson 1827 — What is Instant? Epoch Time RepresentationLesson 1838 — LocalTime: Representing Time Without Date
- narrowing conversion
- occurs when you try to assign a value from a larger data type to a smaller one—like pouring water from a big bucket into a small cup.
- Lesson 78 — Narrowing Conversions: Potential Data LossLesson 81 — Precision Loss in Floating-Point to Integer Casts
- Natural Formatting
- Perfect for SQL, JSON, HTML, or any formatted text
- Lesson 2234 — What Are Text Blocks?
- natural ordering
- the default way objects of that type should be sorted.
- Lesson 268 — Arrays.sort for Object ArraysLesson 974 — SortedSet and SortedMap: Ordered CollectionsLesson 1068 — Creating TreeSet with Natural OrderingLesson 1133 — Creating TreeMaps with Natural OrderingLesson 1135 — Key Requirements: Comparable or ComparatorLesson 1183 — What Is a PriorityQueue?Lesson 1184 — Creating a PriorityQueue with Natural OrderingLesson 1219 — Collections.sort for List Ordering (+4 more)
- NavigableMap
- come in—they extend the sorted interfaces with powerful navigation methods that let you "walk around" your collection with precision.
- Lesson 975 — NavigableSet and NavigableMap: Enhanced Navigation
- NavigableSet
- and **NavigableMap** come in—they extend the sorted interfaces with powerful navigation methods that let you "walk around" your collection with precision.
- Lesson 975 — NavigableSet and NavigableMap: Enhanced Navigation
- Need both
- → Combine them: `user.
- Lesson 1797 — Side Effects with ifPresent: When to Use vs Alternatives
- Need flexibility
- the same logic applies to multiple types
- Lesson 1698 — When to Use Primitive Specializations vs Generics
- Negative `n`
- Removes up to `n` spaces from each line (won't remove non-whitespace)
- Lesson 2221 — The indent Method: Adding Leading Whitespace
- Negative distance
- → elements rotate **to the left** (toward the beginning)
- Lesson 1235 — Rotate with Positive and Negative Distances
- Negative indices
- Unlike some languages, Java doesn't support counting backwards from the end
- Lesson 245 — ArrayIndexOutOfBoundsException and Bounds Checking
- Negative int
- (any negative number, typically -1): "I come *before* the other object"
- Lesson 1312 — The compareTo Method Signature
- Negative integer
- if `this` is *less than* `other`
- Lesson 1310 — The Comparable<T> InterfaceLesson 1311 — Implementing Comparable in a Custom ClassLesson 1328 — The Comparator Interface: Purpose and Function SignatureLesson 2222 — Negative Indentation: Removing Leading Spaces
- Negative limit
- Splits as many times as possible and **keeps** trailing empty strings.
- Lesson 2208 — Limit Parameter in split(): Controlling Array Size
- Negative Lookahead `(?!...)`
- Asserts that what follows does *not* match the pattern
- Lesson 2302 — Understanding Zero-Width Assertions
- Negative Lookbehind `(?<!...)`
- Asserts that what precedes does *not* match the pattern
- Lesson 2302 — Understanding Zero-Width Assertions
- negative number
- `-6`.
- Lesson 118 — The Bitwise NOT Operator (~)Lesson 269 — Arrays.sort with a ComparatorLesson 1069 — How compareTo Determines TreeSet OrderingLesson 1223 — binarySearch Return Values and Insertion Points
- negative value
- if not found: specifically `(-(insertion point) - 1)`, where insertion point is where the element would belong
- Lesson 1222 — Collections.binarySearch on Sorted ListsLesson 1313 — Return Values: Negative, Zero, PositiveLesson 1319 — The compareTo Method Signature and Return Values
- Neither null
- delegates to the wrapped comparator
- Lesson 1350 — The nullsFirst() Method: Null-Safe Comparisons
- Nested causes
- if the exception wrapped another exception
- Lesson 768 — Rethrowing the Same Exception Instance
- Nested if statements
- let you place one `if` statement inside another, creating a decision tree with multiple levels.
- Lesson 138 — Nested if Statements: Multi-Level Decisions
- Nested locks
- occur when code acquires one lock while already holding another.
- Lesson 2699 — Avoiding Nested Locks and Minimizing Lock Scope
- Nested try-catch
- The `close()` method itself throws exceptions, requiring *another* try-catch inside `finally`
- Lesson 850 — The Classic finally Block Pattern
- Network I/O
- Often benefits from larger buffers (64KB+) to match TCP window sizes.
- Lesson 1952 — Buffer Size Selection and Throughput
- Network operations
- If a connection times out, the caller might retry, use cached data, or notify the user to check their connection.
- Lesson 789 — When to Use Checked Exceptions: Recoverable Conditions
- Network sockets
- Close connections to free up ports and system resources.
- Lesson 734 — Common finally Use Cases: Resource Cleanup
- Network streams
- More data might arrive after you call `available()`
- Lesson 1909 — The available() Method and Stream AvailabilityLesson 1931 — Flushing Output Streams
- Neutrality
- `identity op x = x` (the identity doesn't change results)
- Lesson 1507 — Identity Element Requirements: Associativity and Neutrality
- never
- narrows automatically during overload resolution (no `int` → `byte`)
- Lesson 213 — Overloading with Primitive WideningLesson 214 — Overloading with Autoboxing and VarargsLesson 1909 — The available() Method and Stream AvailabilityLesson 2174 — String Methods Return New InstancesLesson 2605 — Responding to InterruptedException: Best Practices
- Never deserialize untrusted data
- This is rule zero.
- Lesson 2166 — Best Practices for Safe Serialization
- Never make fields public
- Always use accessor methods to preserve encapsulation
- Lesson 712 — Cross-Package Access Patterns and Best Practices
- Never reuse
- the class's type parameter name in a method declaration unless you truly intend to create an independent type parameter (which is rarely what you want)
- Lesson 873 — Common Pitfalls: Type Parameter Shadowing
- Never static-import common names
- like `of`, `get`, or `create` that exist in many classes
- Lesson 675 — Static Import Anti-Patterns and Best Practices
- Never throw exceptions
- from `process()` — they halt compilation with cryptic errors.
- Lesson 2460 — Debugging Annotation Processors
- Never throws checked exceptions
- Unlike most I/O classes, PrintWriter methods don't throw IOException; you check errors with `checkError()`
- Lesson 2016 — PrintWriter Overview: Formatted Text Output
- new
- abstract methods
- Lesson 483 — Abstract Subclasses: Deferring ImplementationLesson 1025 — Removing the First ElementLesson 1510 — The Three-Argument reduce: Handling Different TypesLesson 1661 — Chaining Consumers with andThenLesson 1833 — Instant Arithmetic: plus(), minus(), and Temporal UnitsLesson 2167 — What Immutability Means for StringsLesson 2580 — Thread States Overview: The Five-State Model
- New fields
- that store additional state specific to the subclass
- Lesson 399 — Adding New Fields and Methods in Subclasses
- New file or overwrite
- Lesson 1970 — FileWriter: Writing Characters to Text Files
- new instance
- using modification methods.
- Lesson 1843 — Immutability and Modification Methods: plus and minusLesson 2163 — The readResolve Method for Singleton Protection
- New methods
- that provide behaviors the superclass doesn't offer
- Lesson 399 — Adding New Fields and Methods in Subclasses
- New node's `next`
- → points to the target node (the one originally at this position)
- Lesson 1024 — Inserting Elements in the Middle
- New node's `prev`
- → points to the node that was before the target
- Lesson 1024 — Inserting Elements in the Middle
- new stream
- each time:
- Lesson 1396 — Streams Are Single-Use: Terminal Operations Consume ThemLesson 1420 — filter Syntax and Predicate Parameter
- New tasks are rejected
- any subsequent `execute()` calls throw `RejectedExecutionException`
- Lesson 2715 — Graceful Shutdown: The shutdown Method
- next
- – a reference to the next node in the chain
- Lesson 1028 — Memory Overhead of NodesLesson 1042 — Memory Overhead: ArrayList Capacity vs LinkedList NodesLesson 1106 — Bucket Contents: Linked List NodesLesson 1379 — Bounded iterate() with Predicate (Java 9+)
- No
- → use `while`
- Lesson 160 — Choosing Between while and do-whileLesson 356 — Initialization Order with Constructor ChainingLesson 468 — Performance Implications of Dynamic DispatchLesson 532 — Decision Criteria: A Practical ChecklistLesson 789 — When to Use Checked Exceptions: Recoverable ConditionsLesson 1413 — Terminal Short-Circuiting: anyMatch, allMatch, noneMatchLesson 1532 — Understanding Match Operations OverviewLesson 1806 — When to Use flatMap vs map (+2 more)
- No `ConcurrentModificationException`
- The iterator cannot detect modifications because it's working with its own copy
- Lesson 1306 — CopyOnWriteArrayList: A Fail-Safe Example
- No `extends` Clause
- Lesson 2431 — Restrictions on Annotation Declarations
- No `null` Values
- Lesson 2431 — Restrictions on Annotation Declarations
- No `throws` Clause
- Lesson 2431 — Restrictions on Annotation Declarations
- No `transient` keyword needed
- Since nothing is automatic, you choose what to serialize
- Lesson 2149 — The Externalizable Interface and Its Contract
- No accidental coupling
- Classes can't depend on internal helper logic
- Lesson 523 — Visibility Rules: Private Methods Cannot Be Overridden
- No automatic field serialization
- You must explicitly write and read every field
- Lesson 2149 — The Externalizable Interface and Its Contract
- No Capacity Restrictions
- `ArrayDeque` has no fixed capacity limit.
- Lesson 1202 — What is ArrayDeque? Overview and Purpose
- No chaining
- You can't say "when this completes, do that next"
- Lesson 2777 — What is CompletableFuture and Why Use It?
- No checked exceptions
- You can't throw checked exceptions from `run()`
- Lesson 2749 — The Callable<V> Interface and Its Purpose
- No class required
- You can bound by interfaces only: `<T extends Interface1 & Interface2>`
- Lesson 921 — Syntax: Combining extends with &
- No combination exists
- for your specific accumulation logic
- Lesson 1623 — When to Write Custom Collectors vs Compose Existing Ones
- No combining
- You can't easily merge results from multiple futures
- Lesson 2777 — What is CompletableFuture and Why Use It?
- No compiler help
- The compiler won't warn you if you forget to check
- Lesson 1755 — Traditional null Checking: Verbose and Error-Prone
- No concurrent reads
- even though multiple threads could safely read simultaneously
- Lesson 1032 — Vector's Synchronization Mechanism
- No ConcurrentModificationException
- You can modify the collection while iterating without throwing exceptions
- Lesson 1305 — What Is Fail-Safe Behavior?
- No constructors
- You cannot write a constructor inside an interface.
- Lesson 495 — Interfaces vs Abstract Classes: Initial Comparison
- No daylight saving awareness
- Lesson 1838 — LocalTime: Representing Time Without Date
- No direct dependency
- You don't `requires` the provider modules—they can be added or removed without recompiling your consumer module
- Lesson 2500 — The 'uses' Directive in module-info.java
- No duplicate logic
- The iteration code already exists in `HashMap`
- Lesson 1053 — HashSet Iterator: Iterating HashMap Keys
- No Duplicates
- If you try to add an element that's already in the set, HashSet simply ignores it.
- Lesson 993 — HashSet: Unique Elements with Hashing
- No encapsulation
- All public classes in all JARs are globally accessible
- Lesson 2516 — Classpath Mechanics: How the JVM Finds Classes
- No exception handling
- You can't attach error handlers; exceptions surface only during `get()`
- Lesson 2777 — What is CompletableFuture and Why Use It?
- No exception is thrown
- this is a *compatible* class change (as you learned in the previous lesson)
- Lesson 2127 — Adding Fields to a Serializable Class
- No exception occurs
- code flows normally through `try`, skips `catch`, runs `finally`
- Lesson 733 — The finally Block: Guaranteed Execution
- No exceptions
- The iterator never throws `ConcurrentModificationException`, even if other threads modify the map
- Lesson 1307 — ConcurrentHashMap and Weakly Consistent IteratorsLesson 1992 — StandardCharsets for Common Encodings
- No explicit dependencies
- The JVM doesn't know what your application needs until runtime failure occurs
- Lesson 2516 — Classpath Mechanics: How the JVM Finds Classes
- No full-array scanning
- You only search within one bucket, not the entire HashMap
- Lesson 1112 — Performance Characteristics: O(1) Average Case
- No guaranteed order
- Entries aren't stored in insertion or sorted order
- Lesson 997 — HashMap: Key-Value Pairs with HashingLesson 1550 — Collectors.toSet(): Collecting into a Set
- No guarantees
- The garbage collector might never call `finalize()`, or it might call it hours after your object becomes unreachable
- Lesson 300 — The finalize Method (Deprecated)Lesson 574 — The finalize Method: Legacy Cleanup Mechanism
- No hash collisions
- Each enum ordinal is unique by definition
- Lesson 603 — EnumMap Performance: Array-Based Implementation
- No implementation classes
- Lesson 2502 — Creating a Service Interface Module
- No indexing
- You can't ask for "the 5th element" of a stream like you can with a `List`.
- Lesson 1367 — Streams Are Not Data Structures
- No inheritance baggage
- `Deque` doesn't inherit problematic methods
- Lesson 1211 — Why Deque Is Preferred Over Stack Class
- No inheritance relationships
- You cannot list a parent and child exception together (e.
- Lesson 761 — Multi-Catch Syntax (Java 7+)
- No instance fields
- Interfaces cannot hold state (instance variables).
- Lesson 495 — Interfaces vs Abstract Classes: Initial Comparison
- No interface methods
- unless the class itself declares them
- Lesson 2334 — Getting Declared Methods: Class-Specific Methods Only
- No intermediate storage
- Elements pass through without being collected first
- Lesson 1613 — Performance Benefits of teeing Over Multiple Passes
- No JIT optimization
- The compiler can't inline or optimize reflective calls as aggressively
- Lesson 2350 — Performance Costs of Reflective Invocation
- No Manual Configuration
- The module system handles discovery automatically—no classpath scanning or configuration files needed.
- Lesson 2504 — Loading Services with ServiceLoader.load()
- No memory allocation
- Unlike reading into a byte array, skipping doesn't require buffer space
- Lesson 1910 — The skip(long) Method for Skipping Bytes
- No modification
- Streams don't have `add()` or `remove()` methods—they transform data without changing the original source.
- Lesson 1367 — Streams Are Not Data Structures
- No null checks needed
- – you always get a numeric result, never null
- Lesson 1594 — Handling Empty Streams with Summing and Averaging Collectors
- No null elements permitted
- throws `NullPointerException` immediately
- Lesson 1244 — Immutable Factory Methods: List.of, Set.of, Map.of
- No nulls
- TreeSet cannot store `null` (it needs to compare elements)
- Lesson 1066 — What is TreeSet? Sorted Set Fundamentals
- No overhead
- Direct access to array elements without additional wrappers
- Lesson 1392 — Collection.stream() vs Arrays.stream() Performance Considerations
- no parameters
- .
- Lesson 339 — Standard Getter Method Naming and StructureLesson 1667 — Lambda Syntax for Suppliers
- No Random Access Needed
- Lesson 992 — LinkedList: When to Use It
- No read/write distinction
- Reading requires the same exclusive lock as writing
- Lesson 1251 — Performance Implications of Synchronized Wrappers
- No recovery
- Unlike some systems with "recycle bins," this is permanent deletion
- Lesson 2060 — Files.delete: Deleting Files and Directories
- No Redundant Extraction
- Lesson 1792 — ifPresent vs isPresent+get: Why ifPresent Is Better
- No return value
- `forEach` returns `void`—it doesn't produce a result you can store or pass along
- Lesson 1488 — Understanding forEach as a Terminal OperationLesson 2749 — The Callable<V> Interface and Its Purpose
- No risk of `NoSuchElementException`
- the guard condition prevents it
- Lesson 1278 — The Canonical Iterator Loop Pattern
- No runtime type information
- At runtime, `Box<String>` and `Box<Integer>` are both just `Box` containing `Object` references
- Lesson 893 — Type Parameters Become Object
- No shared state needed
- You're defining a pure contract of capabilities
- Lesson 532 — Decision Criteria: A Practical Checklist
- No size limit
- Works with gigabytes of data as easily as kilobytes
- Lesson 2014 — Processing Large Files with readLine
- No state needed
- These markers don't require constructors, fields, or shared logic.
- Lesson 530 — Marker Interfaces vs Empty Abstract Classes
- No surprises
- Forgetting about a global CLASSPATH can cause mysterious bugs
- Lesson 691 — The CLASSPATH Environment Variable
- No time zone context
- `LocalDate` doesn't know about time zones.
- Lesson 1836 — LocalDate: Representing Dates Without Time
- No Type Parameters (Generics)
- Lesson 2431 — Restrictions on Annotation Declarations
- No unnecessary synchronization
- Operations are fast in single-threaded contexts
- Lesson 1211 — Why Deque Is Preferred Over Stack Class
- No wasted transformations
- If only 10 elements are needed from a million-element stream, only those 10 get processed
- Lesson 1406 — Why Laziness Matters for Performance
- NoClassDefFoundError
- happens when a class *was* available during compilation but is missing at runtime.
- Lesson 693 — Common Classpath Issues and ClassNotFoundExceptionLesson 782 — VirtualMachineError and LinkageError: System-Level Errors
- Node
- objects.
- Lesson 1020 — Node Structure in LinkedListLesson 1113 — What Happens When Two Keys Hash to the Same Bucket
- Non-destructive
- Unlike `poll()`, iteration doesn't modify the queue
- Lesson 1173 — Queue Iteration Order and Iterator BehaviorLesson 1384 — stream() Method on Collections
- non-deterministic
- they appear randomly, are hard to reproduce, and can pass testing only to fail in production under heavy load.
- Lesson 1247 — Why Collections Need SynchronizationLesson 2577 — Starting Multiple ThreadsLesson 2642 — What Is a Race Condition?
- Non-Latin alphabets
- Cyrillic (Русский), Greek (Ελληνικά), Arabic ( اﻟﻌﺮﺑﯿﺔ)
- Lesson 1998 — ASCII and Its Limitations
- non-modular JAR
- is placed on the **module path** (not classpath), the JVM automatically converts it into an **automatic module**.
- Lesson 2515 — Modular JARs vs Non-Modular JARs at RuntimeLesson 2535 — What Are Automatic Modules?
- Non-modular JAR on classpath
- Joins the "unnamed module" (pre-JPMS behavior)
- Lesson 2515 — Modular JARs vs Non-Modular JARs at Runtime
- Non-Recursive Monitoring
- By default, registering a directory only watches that single directory—not its subdirectories.
- Lesson 2102 — Closing WatchService and Limitations
- Non-serializable by nature
- fields you know would cause `NotSerializableException`
- Lesson 2132 — Marking Fields as transient
- Non-Serializable Object Fields
- Lesson 2109 — Common NotSerializableException Scenarios
- none
- , or even add **new** abstract methods
- Lesson 483 — Abstract Subclasses: Deferring ImplementationLesson 1537 — noneMatch: Testing If No Elements Match
- Normal unwinding
- `methodB` finishes → frame popped → control returns to `methodA` at the line after `methodB()`.
- Lesson 749 — Normal Stack Unwinding
- Normalization
- Converting to uppercase/lowercase and finding unique values
- Lesson 1483 — Using distinct After Transformations
- Normalizing line breaks
- Lesson 2291 — Whitespace Normalization Patterns
- NoSuchFileException
- is thrown when you try to list a directory that simply doesn't exist on the filesystem.
- Lesson 2082 — Error Handling: NoSuchFileException and AccessDeniedException
- NoSuchMethodException
- occurs when you try to access a method that doesn't exist.
- Lesson 811 — ReflectiveOperationException Hierarchy
- not
- short-circuit.
- Lesson 111 — Logical XOR Operator: ^Lesson 147 — Switch with Primitive Types: int, byte, short, charLesson 314 — Multiple Instances: Each Object Has Its Own StateLesson 456 — Pattern Matching with Logical OperatorsLesson 540 — toString in Collections and ArraysLesson 665 — Package Hierarchies Are Not InheritanceLesson 689 — The Classpath: Finding Classes at RuntimeLesson 711 — Import Statements Do Not Grant Access (+23 more)
- Not allowed
- Wider (superclass) or unrelated type
- Lesson 419 — Return Type Compatibility in OverridingLesson 708 — Accessing Protected Members in Subclasses Across PackagesLesson 1711 — Mixing Explicit and Inferred Types (Not Allowed)
- Not documenting clone behavior
- Always specify whether your `clone()` performs shallow or deep copying in your class documentation.
- Lesson 570 — Clone Best Practices and Common Pitfalls
- Not guaranteed
- The method makes a "best effort" but may skip zero bytes in some cases
- Lesson 1910 — The skip(long) Method for Skipping Bytes
- not inherited
- by any class that implements the interface.
- Lesson 523 — Visibility Rules: Private Methods Cannot Be OverriddenLesson 716 — Private Members Are Not Inherited
- Not Thread-Safe
- Like most collection classes (except the concurrent ones), `ArrayDeque` is not synchronized for concurrent access.
- Lesson 1202 — What is ArrayDeque? Overview and PurposeLesson 1247 — Why Collections Need Synchronization
- Not truly behavioral contracts
- Marker interfaces are pure metadata; empty abstract classes imply (incorrectly) that there might be shared code.
- Lesson 530 — Marker Interfaces vs Empty Abstract Classes
- nothing
- Lesson 1402 — What Is Lazy Evaluation?Lesson 2732 — execute vs submit: Return Type Differences
- Notify requesters
- that their work wasn't completed
- Lesson 2771 — Return Values: Handling Unexecuted Tasks
- NTFS (Windows)
- 100-nanosecond resolution
- Lesson 2071 — Files.getLastModifiedTime() and File Timestamps
- Null arguments without handling
- Passing `null` for `%s` prints "null" (usually fine), but `%d` with null crashes.
- Lesson 2233 — Common Formatting Patterns and Pitfalls
- Null check required
- You must check if the resource was actually initialized
- Lesson 850 — The Classic finally Block Pattern
- Null for primitives
- You pass `null` for a `boolean` parameter
- Lesson 2349 — Type Safety and IllegalArgumentException Risks
- Null handling
- One `null` is allowed (subsequent nulls are duplicates)
- Lesson 1550 — Collectors.toSet(): Collecting into a Set
- Null permitted
- Both null keys and null values are allowed
- Lesson 997 — HashMap: Key-Value Pairs with Hashing
- Null target type
- Lesson 1715 — Inference Limitations and Ambiguity
- Null-returning
- "I'll try to get $50, but if it fails, I'll handle it quietly.
- Lesson 1178 — Exception-Throwing vs Null-Returning Methods
- Null-Returning Behavior
- Lesson 289 — Overriding equals: The Contract and Rules
- Null-returning methods
- (`offer`, `poll`, `peek`) fail silently.
- Lesson 1178 — Exception-Throwing vs Null-Returning MethodsLesson 1205 — Removing Elements: removeFirst, removeLast, pollFirst, pollLast
- NullPointerException
- You tried to use an object reference that's null.
- Lesson 790 — When to Use Unchecked Exceptions: Programming ErrorsLesson 1247 — Why Collections Need Synchronization
- Number of parameters
- (one method takes 2 parameters, another takes 3)
- Lesson 207 — Method Overloading Fundamentals
- NumberFormatException
- if the content isn't numeric → skip the invalid line, continue
- Lesson 756 — The Need for Multiple catch Blocks
- Numeric primitives
- (`int`, `long`, `double`, etc.
- Lesson 307 — Field Initialization: Default ValuesLesson 350 — Default Values for Uninitialized FieldsLesson 2133 — Default Values After Deserialization
O
- O(1)
- and incredibly efficient.
- Lesson 599 — EnumSet Performance: Bit Vector ImplementationLesson 1012 — The add Operation: Common Case Without ResizeLesson 1016 — Amortized Analysis: Why O(1) Despite Occasional O(n)Lesson 1026 — Removing the Last ElementLesson 1037 — Time Complexity: ArrayList vs LinkedList for AccessLesson 1050 — HashSet contains: Leveraging HashMap containsKeyLesson 1052 — HashSet size and isEmpty: Direct DelegationLesson 1189 — Time Complexity of PriorityQueue Operations (+1 more)
- O(1) average-case performance
- for `get`, `put`, and `remove` operations.
- Lesson 1141 — TreeMap vs HashMap: When to Choose Sorted Maps
- O(1) average-time complexity
- for basic operations—blazingly fast.
- Lesson 981 — HashSet vs TreeSet: Performance vs Ordering Trade-offs
- O(1) constant time
- even though it sometimes triggers an **O(n) resize** operation.
- Lesson 1016 — Amortized Analysis: Why O(1) Despite Occasional O(n)Lesson 1181 — Performance Characteristics of LinkedList QueueLesson 1206 — Examining Elements: getFirst, getLast, peekFirst, peekLast
- O(1) guaranteed
- Array access is constant time, always
- Lesson 603 — EnumMap Performance: Array-Based Implementation
- O(1) on average
- , even though individual calls can be O(n).
- Lesson 1016 — Amortized Analysis: Why O(1) Despite Occasional O(n)
- O(1) space
- Only swaps elements in-place, no temporary arrays
- Lesson 1236 — Rotate Internals: Reversal Algorithm
- O(log n)
- because the tree must be rebalanced on insertions and deletions—slower than `HashSet`, but still efficient.
- Lesson 981 — HashSet vs TreeSet: Performance vs Ordering Trade-offsLesson 1138 — Performance Characteristics: O(log n) OperationsLesson 1139 — firstKey, lastKey, and Boundary AccessLesson 1189 — Time Complexity of PriorityQueue Operations
- O(log n) performance
- .
- Lesson 1137 — Red-Black Tree Internals: Balancing OperationsLesson 1141 — TreeMap vs HashMap: When to Choose Sorted Maps
- O(log n) time
- rather than HashMap's O(1).
- Lesson 999 — TreeMap: Sorted Map with Ordered KeysLesson 1117 — Red-Black Trees: The Data Structure Behind Tree Bins
- O(N log K)
- time complexity instead of O(N log N) for full sorting, and you only use **O(K) space** instead of O(N).
- Lesson 1191 — Using PriorityQueue for Top-K Problems
- O(n log n)
- time complexity in the worst case and is **stable** (maintains equal elements' relative order).
- Lesson 1364 — Sorting Performance Considerations
- O(n)
- complexity.
- Lesson 1015 — Array Copying During Resize: System.arraycopyLesson 1016 — Amortized Analysis: Why O(1) Despite Occasional O(n)Lesson 1037 — Time Complexity: ArrayList vs LinkedList for AccessLesson 1063 — Performance Impact of RehashingLesson 1149 — Performance Characteristics of LinkedHashMapLesson 1230 — Reverse Internals: How Swapping WorksLesson 1364 — Sorting Performance ConsiderationsLesson 1565 — Performance Characteristics of joining() (+1 more)
- O(n) linear time complexity
- , where n is the number of elements.
- Lesson 1530 — Performance Characteristics of count, min, and max
- O(n) operation
- in the worst case.
- Lesson 1029 — Why No Index-Based Access OptimizationLesson 1469 — Performance Implications of skip
- O(N) total work
- Lesson 1017 — Counting Operations: N Adds and Log N Resizes
- O(n²)
- in worst cases (though this is rare with modern implementations).
- Lesson 1364 — Sorting Performance ConsiderationsLesson 1565 — Performance Characteristics of joining()
- Object lifecycle violations
- Lesson 798 — IllegalStateException: Detecting Invalid Object States
- Object reference finals
- May *appear* to work initially, but the JVM can optimize based on the assumption the reference never changes.
- Lesson 2357 — Final Fields: Modification Restrictions and Workarounds
- Object references
- become `null`
- Lesson 2127 — Adding Fields to a Serializable ClassLesson 2133 — Default Values After Deserialization
- Object to Property
- Lesson 1430 — Mapping to Different Types
- Object-oriented design
- It feels more natural to ask a list to sort itself rather than hand it to an external utility.
- Lesson 1357 — Sorting Lists with List.sort()
- Obtain the Method object
- using `getDeclaredMethod()` (which can see private methods)
- Lesson 2363 — Invoking Private Methods with setAccessible
- Occasional use
- For one-time initialization, configuration loading, or infrequent operations (like framework setup), the milliseconds lost are irrelevant compared to I/O, network, or database operations.
- Lesson 2350 — Performance Costs of Reflective Invocation
- Occupied
- One or more entries already live in this bucket (a collision scenario)
- Lesson 1108 — put() Operation: Insertion Process
- Octal
- (`0`): rare today, but appears in Unix file permissions
- Lesson 35 — Binary, Octal, and Hexadecimal Integer LiteralsLesson 56 — Integer Literals: Decimal, Hexadecimal, Octal, and Binary
- Off-by-one awareness
- `count < 5` runs 5 times (0–4); `count <= 5` runs 6 times (0–5)
- Lesson 158 — Loop Control Variables and Counting Patterns
- Off-by-one errors
- Using `i <= numbers.
- Lesson 245 — ArrayIndexOutOfBoundsException and Bounds Checking
- OffsetDateTime
- stores a **fixed offset** from UTC (like `+05:00` or `-08:00`).
- Lesson 1870 — OffsetDateTime vs ZonedDateTime
- Old approach (deprecated)
- Lesson 577 — Deprecation of finalize in Java 9+
- Omit types when
- Lesson 1710 — Omitting Parameter Types
- On macOS/Linux
- You'll typically edit your shell configuration file (`.
- Lesson 6 — Adding Java to Your System PATH
- On Windows
- You'll add something like `C:\Program Files\Java\jdk-17\bin` to your PATH variable through System Properties.
- Lesson 6 — Adding Java to Your System PATH
- on-demand
- during the terminal operation.
- Lesson 1426 — Performance Characteristics of filterLesson 2083 — Performance Considerations for Large Directories
- once
- at the very beginning.
- Lesson 165 — The Traditional for Loop: Syntax and ComponentsLesson 361 — static Fields and Memory: Single CopyLesson 524 — Refactoring Default Methods with Private HelpersLesson 1454 — Performance Considerations: sorted vs Pre-Sorted CollectionsLesson 1613 — Performance Benefits of teeing Over Multiple PassesLesson 1619 — Finisher: Transforming the Accumulator to Final ResultLesson 1940 — Nested Buffering Anti-Pattern: Avoid Double BufferingLesson 2252 — Pattern.matches() Static Convenience Method
- one
- public class per `.
- Lesson 18 — Source File and Class Name MatchingLesson 216 — Introduction to Varargs SyntaxLesson 361 — static Fields and Memory: Single CopyLesson 498 — Interface Method Name ConflictsLesson 694 — Class-Level Access Modifiers OverviewLesson 1155 — Null Key and Value RestrictionsLesson 1309 — What Is Natural Ordering?Lesson 1700 — Single Parameter Lambda: Parentheses Optional (+2 more)
- One character
- `'AB'` won't work—`char` holds only a single character.
- Lesson 48 — The char Type: Representing Single CharactersLesson 1962 — Reader's Core Methods: read(), read(char[]), and skip()
- one class
- that works safely with **any type**.
- Lesson 856 — Declaring a Generic Class with a Single Type ParameterLesson 920 — What Are Multiple Bounds in Generics?
- One-Time Use
- If you only reference a class once or twice in a large file, typing the FQN inline can be clearer than adding an import for a single occurrence.
- Lesson 678 — When to Use FQNs vs Import StatementsLesson 1384 — stream() Method on Collections
- only
- on their **signatures**: the method name and the parameter list (count, types, and order).
- Lesson 211 — Return Type Does Not Affect OverloadingLesson 362 — Declaring static MethodsLesson 411 — No-Arg Constructor Requirement in SuperclassesLesson 653 — When Lambda Conversion Is Not PossibleLesson 671 — The java.lang Package: Automatically ImportedLesson 709 — The 'Through Inheritance' RestrictionLesson 865 — What Are Generic Methods?Lesson 1088 — TreeSet's Reliance on compareTo, Not equals (+13 more)
- Only declared methods
- nothing inherited from superclasses
- Lesson 2334 — Getting Declared Methods: Class-Specific Methods Only
- only once
- (single instance)
- Lesson 638 — Local Classes vs Anonymous ClassesLesson 1609 — Basic teeing Example: Min and Max in One Pass
- Only partial state updates
- where just a few lines need protection
- Lesson 2660 — When to Use Synchronized Methods
- Open
- Double-click the `.
- Lesson 4 — Installing the JDK on Your Operating SystemLesson 2365 — Security Manager and Module System RestrictionsLesson 2491 — opens vs exports: Key Differences
- Open hierarchies
- (without `final`) invite extension—think frameworks where users create custom subclasses.
- Lesson 431 — Design Decisions: When to Use final
- Opened packages
- (all `opens` declarations, if any)
- Lesson 2510 — Inspecting Modular JAR Contents with jar --describe-module
- Opening tags
- Lesson 2290 — HTML Tag Matching and Extraction
- OpenJDK
- – The completely free, open-source version that Oracle JDK is based on.
- Lesson 3 — Choosing a JDK Distribution: Oracle, OpenJDK, and Others
- Operations with side effects
- logging, I/O, or state changes
- Lesson 1784 — Choosing Between orElse and orElseGet
- operator precedence
- rules, just like the order of operations you learned in math class.
- Lesson 91 — Operator Precedence: Multiplication Before AdditionLesson 112 — Chaining Comparisons and Operator Precedence
- opposite
- result (logical NOT).
- Lesson 1642 — Combining Predicates with and(), or(), and negate()Lesson 2297 — Predefined Character Classes: \d, \w, \s
- Optimization clarity
- Though modern JVMs optimize well regardless, `final` clearly signals your design intention.
- Lesson 427 — The final Keyword on Classes
- Optimization opportunity
- Because intermediate operations are lazy, Java can optimize the pipeline.
- Lesson 1403 — Intermediate Operations Are Lazy
- Option 1
- Use a single-type import for the class you'll use most:
- Lesson 670 — Import Precedence and Handling Name Conflicts
- Option 1: Type-first syntax
- Lesson 234 — Array Declaration Syntax
- Option 2
- Use fully qualified names when you need the "other" class:
- Lesson 670 — Import Precedence and Handling Name Conflicts
- Option 2: Variable-name syntax
- Lesson 234 — Array Declaration Syntax
- Option 3
- Avoid wildcard imports entirely and be explicit about every import.
- Lesson 670 — Import Precedence and Handling Name Conflicts
- Optional
- For smaller values assigned to `long` variables—Java auto-converts `int` to `long` safely
- Lesson 57 — Long Literals and the L SuffixLesson 1281 — Why remove() Is Optional and May Throw UnsupportedOperationExceptionLesson 1636 — When @FunctionalInterface is Optional
- Optional "hook" methods
- (concrete but meant to be overridden)
- Lesson 529 — The Template Method Pattern with Abstract Classes
- Oracle JDK
- – The original from Oracle Corporation.
- Lesson 3 — Choosing a JDK Distribution: Oracle, OpenJDK, and Others
- Order doesn't matter
- Unlike multiple `catch` blocks, the order of types in a multi-catch doesn't affect compilation
- Lesson 761 — Multi-Catch Syntax (Java 7+)
- Order guarantee
- The iterator order **must** match the queue's retrieval order
- Lesson 1173 — Queue Iteration Order and Iterator Behavior
- order matters
- .
- Lesson 969 — List Interface: Ordered Collections with DuplicatesLesson 1542 — findFirst: Deterministic Element SelectionLesson 1545 — findFirst vs findAny in Sequential StreamsLesson 1646 — Short-Circuit Evaluation in Predicate ChainsLesson 2115 — Serializing Multiple Objects in Sequence
- Order of parameter types
- (one takes `(int, String)`, another takes `(String, int)`)
- Lesson 207 — Method Overloading Fundamentals
- Order parameters logically
- Required information first, optional details later.
- Lesson 324 — Choosing Constructor Overload Signatures
- Order preserved
- The returned list matches the input collection's order
- Lesson 2758 — invokeAll: Executing Multiple Callables
- Ordered Collection
- Elements maintain insertion order.
- Lesson 969 — List Interface: Ordered Collections with Duplicates
- ordered streams
- where elements follow a pattern (like sorted data).
- Lesson 1415 — Intermediate Short-Circuiting: takeWhile (Java 9+)Lesson 1471 — What Are takeWhile and dropWhile?Lesson 1478 — Performance Characteristics and Short-Circuiting
- Ordering queries
- Find elements before or after a specific value
- Lesson 974 — SortedSet and SortedMap: Ordered Collections
- Ordering sensitivity
- In parallel streams, `distinct()` can be expensive because threads must coordinate to maintain a shared state of "seen" elements.
- Lesson 1447 — The Stateful Nature of distinct
- ordinal
- (its position in the enum declaration, starting at 0) serves as the array index.
- Lesson 603 — EnumMap Performance: Array-Based ImplementationLesson 1881 — dayOfWeekInMonth: Nth Occurrence of a Day
- Organization
- Group related classes logically (e.
- Lesson 658 — What Are Packages and Why They MatterLesson 2517 — Module Path Introduction: A New Way to Organize Code
- ORM Mapping
- Annotations like `@Entity`, `@Column`, and `@Id` let frameworks translate Java objects to database rows.
- Lesson 2387 — Practical Use Cases: Frameworks and Custom Processing
- ORM Tools (Hibernate, JPA)
- Lesson 2439 — Use Cases for RUNTIME Retention
- Other annotations
- Nested annotation types
- Lesson 2425 — Element Types: Primitives, Strings, and Classes
- Other locales
- Could be `ISO-8859-1`, `Shift_JIS`, `GBK`, etc.
- Lesson 2005 — Default Charset and Platform Dependency
- Other structures
- that better fit your domain needs
- Lesson 1585 — Collecting to Different Data Structures per Partition
- Other useful adjusters
- include `firstDayOfNextMonth()`, `firstDayOfNextYear()`, and day-of-week adjusters like `next()`, `previous()`, and `nextOrSame()` for finding specific weekdays.
- Lesson 1877 — Using Built-in Adjusters from TemporalAdjusters
- OutOfMemoryError
- The JVM has exhausted available heap memory and cannot allocate more objects.
- Lesson 782 — VirtualMachineError and LinkageError: System-Level ErrorsLesson 2729 — Why These Factory Methods May Not Be Production-Ready
- Output
- Lesson 145 — Fall-Through Behavior in Traditional switchLesson 156 — The while Loop: Basic Syntax and Execution FlowLesson 176 — The break Statement in LoopsLesson 179 — break in switch StatementsLesson 181 — break with Labels: Exiting Nested LoopsLesson 182 — continue with Labels: Skipping Outer Loop IterationsLesson 251 — Iterating Arrays in Reverse OrderLesson 259 — Iterating 2D Arrays with Nested Loops (+8 more)
- Output shows each stage
- Lesson 1459 — Observing Transformations Between Operations
- OutputStream
- is the abstract superclass for all classes that write bytes.
- Lesson 1904 — The InputStream and OutputStream Abstract Classes
- OutputStreamWriter constructors
- Lesson 1990 — Specifying Charset in Bridge Constructors
- outside
- (at the end of the chain), it reverses *everything*, including where nulls land.
- Lesson 1355 — Order of Operations: reversed() vs Null MethodsLesson 2179 — When Strings Are NOT Interned
- Outside the package
- *Only subclasses* can access the `protected` member, and only through inheritance
- Lesson 706 — Protected Members and Package Boundaries
- Overall time complexity
- O(n) where n is total stream size
- Lesson 1448 — Performance Implications of distinct on Large Streams
- Overflow
- occurs when a positive value is too large for the target type.
- Lesson 85 — Casting Pitfalls: Overflow, Underflow, and Best PracticesLesson 1326 — Using Integer.compare and Other Wrapper Comparisons
- overloaded
- if they share the same name but differ in:
- Lesson 207 — Method Overloading FundamentalsLesson 1386 — Arrays.stream() for Array-to-Stream ConversionLesson 2189 — Common StringBuilder Methods: append and insert
- Overloaded methods
- accept different functional interfaces with similar lambda signatures
- Lesson 1731 — Target Type from Cast Expressions
- Overridden methods
- When your subclass replaces a method but still wants to run the parent's logic first
- Lesson 403 — The super Keyword: Accessing Superclass MembersLesson 442 — Dynamic Dispatch with Upcast References
- Overriding
- and **overloading** are both ways to have multiple methods with the same name, but they serve different purposes:
- Lesson 416 — Overriding vs OverloadingLesson 518 — Static Methods vs Default Methods: Key Differences
- overwrite
- it completely—the old contents vanish as soon as you open the stream.
- Lesson 1917 — Understanding FileOutputStream: Writing Bytes to FilesLesson 1918 — FileOutputStream Constructors: Overwrite vs Append Mode
- overwrites
- the first, even though `equals()` says they're different people.
- Lesson 1136 — Consistent Ordering and equals ContractLesson 1918 — FileOutputStream Constructors: Overwrite vs Append ModeLesson 1970 — FileWriter: Writing Characters to Text FilesLesson 1971 — Append Mode: Adding to Existing Files with FileWriterLesson 2644 — Why count++ Is Not Atomic
P
- Package access
- Any class in the same package can access `protected` members (just like package-private)
- Lesson 330 — protected: Inheritance and Package Access
- Package-level tidiness
- You want to avoid cluttering the package with helper classes that outsiders shouldn't typically use directly
- Lesson 619 — Static Nested Classes vs Top-Level Classes
- package-private
- Department files—everyone in your department can access
- Lesson 326 — The Four Access Levels in JavaLesson 328 — Package-Private (Default) AccessLesson 331 — Access Modifiers on ClassesLesson 332 — Access Modifiers on FieldsLesson 696 — Package-Private Classes (Default Access)Lesson 698 — Member-Level Access Modifiers: The Four OptionsLesson 700 — Package-Private Members: Default Package VisibilityLesson 703 — Comparing Class-Level and Member- Level Access (+3 more)
- Package-private (default)
- – The class is only accessible within its own package
- Lesson 331 — Access Modifiers on ClassesLesson 335 — Comparing Access Levels: A Decision MatrixLesson 398 — Access Modifiers and Inherited MembersLesson 698 — Member-Level Access Modifiers: The Four Options
- Package-Private Constructor
- Only classes in the same package can instantiate—useful for internal frameworks.
- Lesson 334 — Access Modifiers on Constructors
- Package-private methods
- (no modifier): Classes in the same package can call these—useful for closely related classes
- Lesson 333 — Access Modifiers on Methods
- Padding and formatting
- Lesson 2219 — The repeat Method: Duplicating Strings
- Palindrome Checking
- Lesson 1201 — When to Use Deque: Use Cases for Double-Ended Access
- Parallel
- (two threads): Thread 1 computes `10 + 5 = 15`, Thread 2 computes `10 + 3 + 2 = 15`, then combine: `15 + 15 = 30`
- Lesson 1507 — Identity Element Requirements: Associativity and Neutrality
- Parallel composition
- (which you'll learn about with `thenCombine`) launches independent operations simultaneously and combines their results.
- Lesson 2824 — Performance Considerations: Sequential vs Parallel Composition
- Parallel execution
- Both futures start immediately and run independently
- Lesson 2825 — Understanding thenCombine: Combining Independent Futures
- Parallel processing
- Divide computational work across multiple threads to utilize multiple CPU cores.
- Lesson 2560 — When to Use Threads in Java
- parallel streams
- , the behavior changes:
- Lesson 1418 — Ordering and Short-Circuiting: Parallel StreamsLesson 1543 — findAny: Non-Deterministic Selection for Performance
- Parameter Passing
- The simplest alternative is passing context data explicitly through method parameters.
- Lesson 2641 — ThreadLocal Alternatives and When to Avoid It
- Parameter types match
- exactly (same number, same types, same order)
- Lesson 2406 — @Override: Compiler Verification
- parameters
- (things you learned in the previous two lessons), stick with normal camelCase naming:
- Lesson 74 — Naming Conventions for final VariablesLesson 1906 — The read(byte[]) and read(byte[], int, int) MethodsLesson 2119 — writeObject() and readObject() Method Signatures
- Parameters count too
- Method parameters follow the same rule
- Lesson 634 — Accessing Local Variables from Local Classes
- Parsing and validation
- If input data is malformed, the caller might ask for corrected input or skip that record.
- Lesson 789 — When to Use Checked Exceptions: Recoverable Conditions
- Partial cleanup
- Release some resources while letting others handle the error
- Lesson 745 — Re-throwing Exceptions After Partial Handling
- Partial implementation helps
- Some methods can be fully implemented once for all subclasses
- Lesson 525 — Abstract Classes: Is-A with Shared Implementation
- Partial iteration
- (skip elements, custom step sizes)
- Lesson 1296 — Enhanced For Loop vs Traditional For Loop
- Partial progress illusion
- Some threads continue working normally while others silently deadlock, making diagnosis challenging.
- Lesson 2694 — Deadlock with Multiple Threads and Resources
- Partitioning
- splitting data based on true/false conditions
- Lesson 1522 — Why collect Is the Gateway to Advanced Collectors
- Pass a Class object
- (advanced, uses reflection—not yet covered in detail):
- Lesson 864 — Restrictions: Cannot Instantiate Type Parameters with new T()
- Pass an instance directly
- Lesson 864 — Restrictions: Cannot Instantiate Type Parameters with new T()
- PATH
- is like a shortcut list your operating system maintains.
- Lesson 6 — Adding Java to Your System PATH
- Pattern
- takes a regular expression string (like `"\\d+"` for one or more digits) and compiles it into an optimized, reusable form.
- Lesson 2244 — Introduction to Pattern and MatcherLesson 2466 — Compiling a Module with javac
- pattern variable
- `i` that you can use immediately in the arrow expression.
- Lesson 154 — Pattern Matching in switch (Preview/Java 17+)Lesson 453 — Pattern Matching for instanceof: Basic SyntaxLesson 454 — Pattern Variables and ScopeLesson 455 — Flow Scoping: Pattern Variables in Conditional Blocks
- PECS
- " principle (Producer Extends, Consumer Super):
- Lesson 933 — Lower Bounded Wildcards: <? super T> SyntaxLesson 939 — The PECS Principle: Producer Extends, Consumer Super
- Per-thread context
- storing user sessions, database connections, or transaction IDs that should be isolated per thread
- Lesson 2633 — What is ThreadLocal and Why It Exists
- Perform a modulo operation
- (wrapping around the circular buffer)
- Lesson 1208 — Performance Characteristics: O(1) Operations
- Perform inline logic
- `employee -> employee.
- Lesson 1339 — Comparator.comparing() with Lambda Expressions
- Performance
- The JVM can optimize `final` methods more aggressively since it knows the implementation won't change
- Lesson 424 — The final Keyword on MethodsLesson 967 — The Collections Framework: Purpose and DesignLesson 981 — HashSet vs TreeSet: Performance vs Ordering Trade-offsLesson 1053 — HashSet Iterator: Iterating HashMap KeysLesson 1066 — What is TreeSet? Sorted Set FundamentalsLesson 1214 — ArrayDeque as a Stack: Implementation ChoiceLesson 1263 — Comparing Factory Methods with Java 9+ Collection FactoriesLesson 1266 — Collections.addAll: Bulk Addition with Varargs (+4 more)
- Performance boost
- Processing stops as soon as the limit is satisfied.
- Lesson 1414 — Intermediate Short-Circuiting: limit Operation
- Performance Constraints
- Watching many directories simultaneously can strain system resources.
- Lesson 2102 — Closing WatchService and Limitations
- Performance is identical
- to manual iteration—no overhead
- Lesson 1292 — How the Enhanced For Loop Works Internally
- Performance matters
- and composition creates unnecessary intermediate objects
- Lesson 1623 — When to Write Custom Collectors vs Compose Existing OnesLesson 1698 — When to Use Primitive Specializations vs GenericsLesson 2524 — Migration Strategy: When to Use Module Path vs Classpath
- Performance optimizations
- The JVM optimizes `String` and wrapper classes aggressively (string pooling, unboxing).
- Lesson 429 — final Classes in the JDK: String and Wrappers
- Performance overhead
- affects garbage collection for all objects
- Lesson 577 — Deprecation of finalize in Java 9+Lesson 1211 — Why Deque Is Preferred Over Stack ClassLesson 1462 — Removing peek in Production Code
- Performance problems
- Objects with `finalize` methods survive longer in memory and slow down garbage collection
- Lesson 300 — The finalize Method (Deprecated)Lesson 574 — The finalize Method: Legacy Cleanup Mechanism
- performance tuning
- in specific scenarios:
- Lesson 2632 — Best Practices: Avoiding Priority RelianceLesson 2803 — Using thenApplyAsync with Custom Executor
- Performance-critical repeated concatenation
- Use `StringBuilder`
- Lesson 2243 — Text Blocks vs String Concatenation
- Performance-sensitive code
- (slightly faster, though rarely significant)
- Lesson 2275 — Named Groups vs Numbered Groups
- Performing I/O operations
- Lesson 1492 — Side Effects in forEach
- Period
- works with **date-based types** (those containing date components):
- Lesson 1865 — Adding Duration and Period to Temporal Objects
- Periodic interrupt checks
- Structure your code to check `Thread.
- Lesson 2607 — Interruption and Non-Interruptible Blocking
- PermGen
- (Permanent Generation), a fixed-size memory area separate from the main heap.
- Lesson 2182 — Intern Pool Location: PermGen vs Metaspace
- Persistence frameworks
- (Hibernate, JPA) need to access private fields in entity classes
- Lesson 2492 — Unconditional opens: Opening Packages to All Modules
- Phase 1
- Convert third-party JARs to automatic modules (place on module path, add `Automatic-Module- Name` if you control the JAR)
- Lesson 2543 — Migration Strategy: From Automatic to Explicit Modules
- Phase 1: Traversal
- Lesson 1024 — Inserting Elements in the Middle
- Phase 2
- Write explicit `module-info.
- Lesson 2543 — Migration Strategy: From Automatic to Explicit Modules
- Phase 2: Four-Pointer Update
- Lesson 1024 — Inserting Elements in the Middle
- Phase 3
- Replace automatic modules with explicit versions:
- Lesson 2543 — Migration Strategy: From Automatic to Explicit Modules
- Phase 4
- Validate with `jdeps` that all automatic modules are eliminated
- Lesson 2543 — Migration Strategy: From Automatic to Explicit Modules
- Phone number formats
- Verifying the entire string matches your expected pattern
- Lesson 2256 — Using matches() for Full String Validation
- Phone numbers
- Every digit in the right place
- Lesson 2260 — When to Use matches(): Input Validation and Format Checking
- pipeline
- of transformations, where each step processes the value if present, or safely short-circuits if absent.
- Lesson 1803 — Chaining Multiple map OperationsLesson 2800 — Chaining Multiple thenApply Calls
- Pipeline position
- Placing `distinct()` early in a pipeline (after narrowing filters) can reduce memory usage compared to placing it late.
- Lesson 1447 — The Stateful Nature of distinct
- Pitfall #2
- Using `LocalDateTime` when you actually need `ZonedDateTime`.
- Lesson 1903 — Migration Checklist and Common Pitfalls
- Pitfall #3
- Replacing `SimpleDateFormat` patterns without checking symbol differences (some symbols changed meaning).
- Lesson 1903 — Migration Checklist and Common Pitfalls
- Pivot-Based Traversal
- Position the iterator at a specific index using `listIterator(index)`, then explore both directions from that pivot point.
- Lesson 1289 — Bidirectional Iteration Patterns
- Places the entry
- in the appropriate bucket of the new array
- Lesson 1128 — Recalculating Hash Indices After Resizing
- Plan replacement strategies
- for each dependency on internal APIs
- Lesson 2530 — Using --add-exports and --add-opens as Temporary Workarounds
- Platform abstraction
- Works consistently across Windows, Linux, and macOS
- Lesson 2025 — Introduction to NIO.2 and the Path Interface
- Platform Behavior Differences
- Different file systems have varying reliability.
- Lesson 2102 — Closing WatchService and Limitations
- Platform differences
- Windows, Linux, and macOS have different scheduler behaviors
- Lesson 2596 — Sleep Precision and Guarantees
- Platform specificity
- `jlink` images are platform-dependent; distributing to Windows, Linux, and macOS requires three separate builds.
- Lesson 2552 — Comparing jlink Images to Traditional Deployments
- Platform-independent
- line endings with `newLine()`
- Lesson 1986 — Complete Example: Reading and Writing Text Files
- Platform-specific builds
- Create separate images for Windows, macOS, and Linux since native binaries differ
- Lesson 2551 — Distributing Custom Runtime Images
- Plugin systems
- Execute methods from dynamically loaded classes
- Lesson 2341 — Overview of Method.invoke and Its Purpose
- plus
- its own additions (`numberOfDoors`, `licensePlate`, and `honkHorn()`).
- Lesson 399 — Adding New Fields and Methods in SubclassesLesson 1079 — Performance CharacteristicsLesson 1923 — Reading Single Bytes with read()
- Polling with backoff
- If your thread checks for a condition repeatedly, sleeping between checks prevents burning CPU cycles unnecessarily.
- Lesson 2590 — The Purpose of Thread.sleep
- Polymorphism
- | Participates in dynamic dispatch | No polymorphism—resolved at compile-time |
- Lesson 518 — Static Methods vs Default Methods: Key Differences
- Pool size
- More generous limits encourage safer use of `intern()`
- Lesson 2182 — Intern Pool Location: PermGen vs Metaspace
- Poor API Design
- The API was confusing and counterintuitive.
- Lesson 1895 — Problems with java.util.Date and java.util.Calendar
- Poor cache performance
- Nodes are scattered across memory
- Lesson 1227 — Performance Characteristics of Sorting
- Poor hashCode()
- All keys hash to the same bucket → degrades to O(n) for that bucket's search
- Lesson 1112 — Performance Characteristics: O(1) Average Case
- Poor Scalability
- Thread creation itself is expensive (milliseconds per thread).
- Lesson 2709 — The Problem with Manual Thread Management
- Portability
- Your code behaves identically on Windows, Mac, and Linux
- Lesson 2044 — Character Encoding and Charset Parameters
- portable and predictable
- across all platforms.
- Lesson 1991 — Default Platform Encoding and Why to Avoid ItLesson 2004 — Specifying Charset in Readers and Writers
- Positional Access
- Retrieve elements by their numeric index:
- Lesson 969 — List Interface: Ordered Collections with Duplicates
- Positive `n`
- Adds `n` spaces to the beginning of each line
- Lesson 2221 — The indent Method: Adding Leading Whitespace
- Positive distance
- → elements rotate **to the right** (toward the end)
- Lesson 1235 — Rotate with Positive and Negative Distances
- Positive int
- (any positive number, typically 1): "I come *after* the other object"
- Lesson 1312 — The compareTo Method Signature
- Positive integer
- if `this` is *greater than* `other`
- Lesson 1310 — The Comparable<T> InterfaceLesson 1311 — Implementing Comparable in a Custom ClassLesson 1328 — The Comparator Interface: Purpose and Function Signature
- Positive limit
- The pattern is applied at most `limit - 1` times.
- Lesson 2208 — Limit Parameter in split(): Controlling Array Size
- Positive Lookahead `(?=...)`
- Asserts that what follows matches the pattern
- Lesson 2302 — Understanding Zero-Width Assertions
- positive lookbehind
- is a zero-width assertion that checks whether a certain pattern exists immediately *before* the current position in the string.
- Lesson 2305 — Positive Lookbehind Syntax: (?<=...)Lesson 2308 — Practical Lookbehind: Currency and Units
- Positive Lookbehind `(?<=...)`
- Asserts that what precedes matches the pattern
- Lesson 2302 — Understanding Zero-Width Assertions
- positive number
- if the first should come after the second
- Lesson 269 — Arrays.sort with a ComparatorLesson 1069 — How compareTo Determines TreeSet Ordering
- Positive value
- (any positive int): `this` object is **greater than** the argument
- Lesson 1313 — Return Values: Negative, Zero, PositiveLesson 1319 — The compareTo Method Signature and Return Values
- Postal codes
- Checking that input is exactly the right format
- Lesson 2256 — Using matches() for Full String ValidationLesson 2260 — When to Use matches(): Input Validation and Format Checking
- Postfix (`i++`)
- Use the current value **first**, then increment
- Lesson 97 — Prefix vs Postfix: Evaluation Order
- Postfix (`x--`)
- The current value is used in the expression *first*, then the variable is decremented afterward.
- Lesson 99 — Using Decrement in Expressions
- Postfix (`x++`)
- The current value is used in the expression *first*, then increment happens
- Lesson 98 — Using Increment in Expressions
- Practical demonstration
- Shows why generics matter (imagine needing `StringArrayList`, `IntegerArrayList`, etc.
- Lesson 900 — ArrayList<E> as the Canonical Generic Collection
- Pre/post processing
- perform actions before entering or after leaving directories (like calculating directory sizes)
- Lesson 2089 — Files.walkFileTree for Complex Traversals
- Precision
- Converting `double` to `int` drops the fractional part: `3.
- Lesson 78 — Narrowing Conversions: Potential Data LossLesson 2228 — Formatting Numbers with Precision
- Predicate
- Tests a condition and returns `true` or `false` (you've used this with `filter` operations)
- Lesson 1629 — Common Functional Interfaces in java.util.function
- Predicate variable
- Lesson 1420 — filter Syntax and Predicate Parameter
- Predictable
- No hidden behavior
- Lesson 387 — Pure Functions and Statelessness in Utility ClassesLesson 727 — Immutability and final: Defensive Access Control
- predictable iteration order
- (enum declaration order)
- Lesson 601 — Introduction to EnumMap: A Specialized Map for Enum KeysLesson 1078 — Internal Structure: HashMap with Linked ListLesson 1151 — When to Use LinkedHashMap vs HashMap
- Predictable JSON/XML serialization
- Keeping fields in insertion order
- Lesson 1151 — When to Use LinkedHashMap vs HashMap
- Predictable resource usage
- You control exactly how many threads exist
- Lesson 2720 — newFixedThreadPool: Creating a Fixed-Size Thread Pool
- Predictable size
- Arrays know their length immediately
- Lesson 1392 — Collection.stream() vs Arrays.stream() Performance Considerations
- Prefer composition when
- Lesson 1623 — When to Write Custom Collectors vs Compose Existing Ones
- Prefer generics
- Use parameterized collections to maintain compile-time type safety
- Lesson 799 — ClassCastException and Type Safety
- Prefer granular handling when
- Lesson 764 — Granular vs General Exception Handling
- Prefer other types when
- Lesson 1856 — Best Practices: When to Use ZonedDateTime
- Prefer parameters over capture
- When possible, pass data as parameters rather than capturing from the enclosing scope:
- Lesson 1726 — Best Practices for Variable Capture
- Prefer single-member imports
- over wildcard imports (`import static Math.
- Lesson 675 — Static Import Anti-Patterns and Best Practices
- Prefer static over non-static
- unless you specifically need access to the outer class's instance members
- Lesson 621 — Common Use Cases and Best Practices
- Prefix (`--x`)
- The variable is decremented *first*, then the new value is used in the expression.
- Lesson 99 — Using Decrement in Expressions
- Prefix (`++i`)
- Increment **first**, then use the new value
- Lesson 97 — Prefix vs Postfix: Evaluation Order
- Prefix (`++x`)
- Increment happens *first*, then the new value is used in the expression
- Lesson 98 — Using Increment in Expressions
- preserve
- order.
- Lesson 1218 — Stack vs Queue Trade-offs in Problem SolvingLesson 2805 — thenApply vs map in Stream API
- Preserve the signal
- for code higher up the call stack
- Lesson 2598 — Restoring Interrupt Status in catch Blocks
- Preserves structure
- Existing indentation differences between lines remain intact
- Lesson 2221 — The indent Method: Adding Leading Whitespace
- Preserving User Intent
- When users select multiple items from a list (think checkboxes), you want to remember the selection order.
- Lesson 1081 — Use Cases for Insertion Order
- Prevent accidental misuse
- by other classes
- Lesson 722 — Default to Most Restrictive: The Principle of Least Privilege
- Prevent future execution
- If the task hasn't started yet (still queued), it's removed from the queue and never runs.
- Lesson 2744 — cancel(): Attempting to Stop Running Tasks
- Prevent starvation
- Avoid blocking the common pool with long-running I/O tasks
- Lesson 2791 — Providing a Custom Executor to runAsync
- Preventing split packages
- is critical for maintaining a clean architecture
- Lesson 2524 — Migration Strategy: When to Use Module Path vs Classpath
- Prevents accidental bugs
- no setter methods means no one can corrupt your data
- Lesson 727 — Immutability and final: Defensive Access Control
- Prevents errors
- no manual `compare()` implementation mistakes
- Lesson 1337 — Introduction to Comparator Factory Methods
- Prevents new task submissions
- (just like `shutdown()`)
- Lesson 2770 — shutdownNow(): Forcing Immediate Termination
- Prevents resource exhaustion
- Controlled concurrency
- Lesson 2712 — Thread Pools: Reusing Threads for Efficiency
- Prevents resource leaks
- Resources are *guaranteed* to close, eliminating a major source of bugs
- Lesson 829 — Why AutoCloseable Matters
- Prevents unintended reuse
- You won't accidentally reuse a variable for a different purpose later
- Lesson 193 — Best Practices for Variable Scope
- Previous node's `next`
- → now points to the new node instead of the target
- Lesson 1024 — Inserting Elements in the Middle
- Price Monitoring
- In financial applications, maintaining sorted price points and efficiently finding the nearest buy/sell prices using `lower()` and `higher()`.
- Lesson 1101 — TreeSet as NavigableSet: Practical Applications
- primitive arrays
- , `Stream.
- Lesson 1387 — Stream.of() with Array ElementsLesson 1502 — Comparing toArray() with collect(toList())
- Primitive fields
- get their type's default: `0` for numbers, `false` for booleans, `'\u0000'` for chars
- Lesson 2127 — Adding Fields to a Serializable Class
- Primitive mismatches
- You pass `int` when `long` is required (no automatic widening)
- Lesson 2349 — Type Safety and IllegalArgumentException Risks
- Primitive streams are different
- Since `IntStream`, `LongStream`, and `DoubleStream` work with primitive types, they already know exactly what array type to create.
- Lesson 1499 — Primitive Streams and toArray()
- Primitive variables
- get sensible "zero" defaults:
- Lesson 280 — Default Values: Primitives vs References
- Primitive widening
- (e.
- Lesson 214 — Overloading with Autoboxing and VarargsLesson 220 — Method Overloading with Varargs
- Primitives
- `int.
- Lesson 2322 — Using .class Literal SyntaxLesson 2425 — Element Types: Primitives, Strings, and Classes
- Principle of Least Privilege
- means giving each part of your code the minimum level of access it needs to do its job—nothing more.
- Lesson 337 — The Principle of Least PrivilegeLesson 722 — Default to Most Restrictive: The Principle of Least Privilege
- Printing to console
- Lesson 1492 — Side Effects in forEach
- Prioritize by risk
- Convert high-churn or security-critical dependencies first
- Lesson 2543 — Migration Strategy: From Automatic to Explicit Modules
- Priority inversion
- occurs when a high-priority thread becomes blocked waiting for a resource held by a low-priority thread.
- Lesson 2631 — Priority Inversion and Starvation Risks
- private
- Your personal diary—only you can read it
- Lesson 326 — The Four Access Levels in JavaLesson 342 — JavaBeans Naming Conventions OverviewLesson 710 — Private Members and Package BoundariesLesson 711 — Import Statements Do Not Grant Access
- Private instance methods
- Called by default methods, can use `this`
- Lesson 520 — Private Methods in Interfaces: Java 9 IntroductionLesson 521 — Private Instance Methods in Interfaces
- private methods
- to support code reuse between default (and static) methods.
- Lesson 520 — Private Methods in Interfaces: Java 9 IntroductionLesson 626 — Accessing Outer Class Methods from Inner Classes
- Private static methods
- Called by static or default methods, cannot use `this`
- Lesson 520 — Private Methods in Interfaces: Java 9 Introduction
- Private visibility
- Only callable within the interface itself
- Lesson 522 — Private Static Methods in Interfaces
- Problem
- Implementing `compareTo` based on one field but `equals` based on another.
- Lesson 1327 — Common compareTo Mistakes and How to Avoid Them
- Problem scenario
- You need a transformed value or a fallback:
- Lesson 1797 — Side Effects with ifPresent: When to Use vs Alternatives
- Problematic libraries
- – those using deep reflection, split packages, or internal JDK APIs
- Lesson 2525 — Assessing Your Application's Readiness for Modules
- process
- is an independent, isolated instance of a running program.
- Lesson 2553 — Process: An Independent Program InstanceLesson 2555 — Memory Isolation: Processes vs ThreadsLesson 2556 — Creation Overhead: Heavy vs Lightweight
- Process in arrival order
- Tasks that should be handled first-come, first-served (like print job scheduling or BFS)
- Lesson 1218 — Stack vs Queue Trade-offs in Problem Solving
- Process innermost/most-recent first
- Nested structures where you need to complete the innermost level before the outer (like expression evaluation or DFS)
- Lesson 1218 — Stack vs Queue Trade-offs in Problem Solving
- Process request
- → Access context as needed
- Lesson 2639 — Common Use Cases: User Context and Request Scoping
- Processes
- Complete memory isolation.
- Lesson 2555 — Memory Isolation: Processes vs ThreadsLesson 2558 — Crash Isolation: Process Safety
- Processing large volumes
- the cumulative cost of boxing millions of primitives is significant
- Lesson 1698 — When to Use Primitive Specializations vs Generics
- Producer
- (provides data you read): use `<?
- Lesson 936 — Comparing extends vs super WildcardsLesson 940 — Producers: When to Use '? extends T'Lesson 944 — Real-World Example: Collections.copy and PECSLesson 948 — Practice: Refactoring Code to Apply PECS
- Producer Extends
- If a collection is *producing* values for you to read (you're taking items *out*), use `<?
- Lesson 939 — The PECS Principle: Producer Extends, Consumer Super
- Producer Extends, Consumer Super
- .
- Lesson 936 — Comparing extends vs super WildcardsLesson 939 — The PECS Principle: Producer Extends, Consumer Super
- Produces a compile-time error
- if the count is zero or more than one
- Lesson 1633 — Compiler Validation of Single Abstract Method
- Professional packaging
- Combine with installer tools (like jpackage) for native installers
- Lesson 2551 — Distributing Custom Runtime Images
- Profile-guided optimization
- The runtime learns which implementations are most common and optimizes accordingly
- Lesson 468 — Performance Implications of Dynamic Dispatch
- programming error
- your code encountered a problem it wasn't prepared to handle.
- Lesson 752 — Unwinding Without a HandlerLesson 802 — UnsupportedOperationException in CollectionsLesson 803 — When to Use RuntimeException vs Checked ExceptionsLesson 1785 — orElseThrow: Throwing When Empty
- programming errors
- mistakes in your code's logic that shouldn't happen if the program is written correctly.
- Lesson 790 — When to Use Unchecked Exceptions: Programming ErrorsLesson 812 — Choosing Between Checked and Unchecked
- Project isolation
- Different projects can have different dependencies without conflicts
- Lesson 691 — The CLASSPATH Environment Variable
- promotes
- (widens) the smaller type to match the larger one before performing the operation.
- Lesson 83 — Mixed-Type Arithmetic and Automatic PromotionLesson 89 — Mixing int and double in Arithmetic Expressions
- Propagate it
- declare `throws InterruptedException` in your method signature
- Lesson 808 — InterruptedException: Thread Interruption
- property
- (also called a field).
- Lesson 240 — Array Length PropertyLesson 246 — Getting Array Length with the length Property
- Property Validation
- Lesson 1640 — Creating Simple Predicates with Lambda Expressions
- protected
- Family heirlooms—your family and descendants can use them
- Lesson 326 — The Four Access Levels in JavaLesson 710 — Private Members and Package BoundariesLesson 711 — Import Statements Do Not Grant AccessLesson 715 — Overriding and Access Levels: The Widening RuleLesson 2481 — Basic exports Syntax in module-info.java
- Protected access matters
- You need to share helper methods or fields that shouldn't be public
- Lesson 525 — Abstract Classes: Is-A with Shared Implementation
- Protected and package-private methods
- Lesson 626 — Accessing Outer Class Methods from Inner Classes
- Protected Constructor
- Allows subclasses to call via `super()`, even if they're in different packages, while restricting general instantiation.
- Lesson 334 — Access Modifiers on Constructors
- Provide implementations
- in separate modules (e.
- Lesson 2498 — The Service Provider Interface (SPI) Pattern
- Provide sensible defaults
- Create constructors that let users specify only what matters, with reasonable defaults for everything else.
- Lesson 324 — Choosing Constructor Overload Signatures
- Provider configuration files
- (legacy classpath mechanism, pre-JPMS)
- Lesson 2499 — The java.util.ServiceLoader Class
- Provides compiler safety
- Prevents accidental addition of extra abstract methods
- Lesson 1636 — When @FunctionalInterface is Optional
- public
- The lobby—open to everyone
- Lesson 326 — The Four Access Levels in JavaLesson 710 — Private Members and Package BoundariesLesson 715 — Overriding and Access Levels: The Widening RuleLesson 2149 — The Externalizable Interface and Its ContractLesson 2332 — Getting Declared Constructors Including Private OnesLesson 2335 — Getting a Specific Method by Name and ParametersLesson 2336 — Getting Fields with getFields()Lesson 2371 — Getting Constructor Objects via Reflection (+1 more)
- public API
- the official interface other code should use.
- Lesson 333 — Access Modifiers on MethodsLesson 702 — public Members: Unrestricted AccessLesson 2473 — Transitive Dependencies: requires transitive
- Public API stability matters
- You're designing a library where backward compatibility is critical (use default methods for evolution)
- Lesson 532 — Decision Criteria: A Practical Checklist
- Public methods inherited
- from superclasses (like `Object`)
- Lesson 2333 — Getting Methods with getMethods()
- Public No-Arg Constructor
- Lesson 342 — JavaBeans Naming Conventions Overview
- Public no-arg constructor required
- The JVM calls this constructor during deserialization, then invokes `readExternal`
- Lesson 2149 — The Externalizable Interface and Its Contract
- Purpose
- | Extend behavior of implementations | Provide helper/utility methods |
- Lesson 518 — Static Methods vs Default Methods: Key Differences
Q
- Qualified vs Unconditional
- Using qualified `opens` (e.
- Lesson 2497 — Security and Design Trade-offs with opens
- Quantifier
- requiring at least 2 letters for the top-level domain
- Lesson 2282 — Matching Email Addresses with Regex
- Query execution errors
- Your SQL statement has syntax errors or references tables/columns that don't exist
- Lesson 806 — SQLException: Database Access Errors
- Queue
- is a collection interface that processes elements in **first-in-first-out (FIFO)** order—just like a line at a coffee shop.
- Lesson 971 — Queue Interface: FIFO ProcessingLesson 972 — Deque Interface: Double-Ended Queue OperationsLesson 1167 — Queue Interface Overview and FIFO Semantics
- Queue and Deque Operations
- Lesson 992 — LinkedList: When to Use It
- Queued tasks continue
- tasks waiting in the queue still get executed
- Lesson 2715 — Graceful Shutdown: The shutdown Method
- Quick fix when stuck
- Most IDEs let you stop a running program (often a red square button), or press `Ctrl+C` in the terminal.
- Lesson 163 — Infinite Loops: Intentional and Accidental
- Quick identification trick
- Ask yourself, "Could I chain another operation after this?
- Lesson 1401 — Identifying Operation Types in Real Code
- Quicksort
- Pick a pivot, partition, sort each partition recursively
- Lesson 233 — When to Use Recursion: Tree Traversal and Divide-and-Conquer
R
- race condition
- .
- Lesson 1162 — Atomic Operations: putIfAbsent, replace, remove with ValueLesson 2642 — What Is a Race Condition?
- race conditions
- and lost updates.
- Lesson 1513 — Common Pitfalls: Non-Associative Operations and Side EffectsLesson 2360 — Performance and Security Implications of Field Access
- random access
- or want to insert/remove from anywhere in the sequence.
- Lesson 1177 — Queue vs List Methods on LinkedListLesson 1954 — Disk I/O Latency and Sequential vs Random AccessLesson 1955 — File Channel and Memory-Mapped I/O PreviewLesson 2048 — Memory Considerations When Reading Entire Files
- Random access is O(1)
- The sorting algorithm can instantly jump to any element by index
- Lesson 1227 — Performance Characteristics of Sorting
- Random access is O(n)
- To reach element [i], you must traverse i nodes from the head
- Lesson 1227 — Performance Characteristics of Sorting
- Random generation
- – Produce random or computed values
- Lesson 1665 — What is Supplier<T> and When to Use It
- range queries
- (finding elements within a range).
- Lesson 981 — HashSet vs TreeSet: Performance vs Ordering Trade-offsLesson 1075 — Performance Trade- offs: TreeSet vs HashSetLesson 1101 — TreeSet as NavigableSet: Practical ApplicationsLesson 1454 — Performance Considerations: sorted vs Pre-Sorted Collections
- Range views
- Get a subset of elements between two values
- Lesson 974 — SortedSet and SortedMap: Ordered Collections
- raw type
- is a generic class or interface used *without* any type arguments.
- Lesson 882 — What Are Raw Types?Lesson 883 — Raw Type Syntax and DeclarationLesson 887 — Raw Types vs Unbounded WildcardsLesson 953 — Unbounded Wildcards vs Raw TypesLesson 962 — Cannot Use instanceof with Parameterized Types
- raw types
- come in.
- Lesson 886 — Interoperating with Pre-Generics CodeLesson 949 — Unbounded Wildcards: The ? Type
- read
- each element (no modifications)
- Lesson 249 — When to Use Indexed vs Enhanced for LoopsLesson 260 — Enhanced for Loop with 2D ArraysLesson 928 — The Unbounded Wildcard: ? BasicsLesson 1145 — Access Order Mode: The accessOrder ParameterLesson 2643 — A Simple Counter ExampleLesson 2644 — Why count++ Is Not AtomicLesson 2685 — volatile Does Not Provide Atomicity for Compound Actions
- Read the error carefully
- it names the missing module
- Lesson 2479 — Diagnosing Missing requires Declarations
- Read-heavy workloads
- ConcurrentHashMap shines.
- Lesson 1165 — Performance Characteristics: Read vs Write Operations
- Read-modify-write operations complete atomically
- from the program's perspective (no other code can intervene)
- Lesson 2649 — Why Single-Threaded Code Doesn't Have These Issues
- read-only
- or **immutable**—you can view their contents but can't add, remove, or change elements.
- Lesson 802 — UnsupportedOperationException in CollectionsLesson 2601 — Checking Interruption Status: isInterrupted()
- readability
- .
- Lesson 381 — Best Practices for static ImportsLesson 475 — Practical Benefits: Avoiding DowncastsLesson 578 — What Are Enums and Why They MatterLesson 658 — What Are Packages and Why They MatterLesson 1266 — Collections.addAll: Bulk Addition with VarargsLesson 1425 — Chaining Multiple filter OperationsLesson 1429 — map with Method ReferencesLesson 1481 — Composing Multiple filter Operations (+2 more)
- Readability establishment
- Only modules connected in the graph can read each other
- Lesson 2470 — Module Graph and Dependencies at Runtime
- Readability suffers
- from deeply nested collector chains
- Lesson 1623 — When to Write Custom Collectors vs Compose Existing Ones
- readable
- .
- Lesson 605 — Practical Use Cases: State Machines and ConfigurationLesson 838 — Try-With-Resources vs Traditional Try-FinallyLesson 1198 — Stack Methods: push, pop, and peekLesson 1614 — When to Use teeing vs Separate Collectors
- Readers and writers
- Can operate concurrently in most cases
- Lesson 1160 — ConcurrentHashMap Overview: Lock Striping Architecture
- Reading
- from both is possible, but raw types return `Object` with no warnings, while wildcards explicitly acknowledge the unknown type.
- Lesson 887 — Raw Types vs Unbounded WildcardsLesson 936 — Comparing extends vs super WildcardsLesson 1961 — Why Character Streams Exist: The Encoding Problem
- Reading configuration files
- or moderate-sized data files
- Lesson 1935 — Default Buffer Size: 8KB Explained
- Reading is allowed
- The local class can read these variables freely
- Lesson 634 — Accessing Local Variables from Local Classes
- Reading is safe
- because anything you pull out can safely be treated as `Object` (Java's universal supertype).
- Lesson 929 — Wildcard Capture and Reading from <?> CollectionsLesson 932 — Why You Cannot Write to <? extends T> Collections
- Reads all modules
- Automatically `requires` every other module it can see
- Lesson 2515 — Modular JARs vs Non-Modular JARs at Runtime
- Reads all other modules
- The unnamed module can access all exported packages from named modules on the module path
- Lesson 2469 — Unnamed Modules and Compatibility
- Real-time or latency-sensitive systems
- – Where microseconds count
- Lesson 755 — Performance Impact of Unwinding
- Real-time requirements
- When another process needs to read the data immediately
- Lesson 1931 — Flushing Output Streams
- Reassignment operators
- inside lambdas: `=`, `++`, `--`, `+=`, etc.
- Lesson 1721 — Attempting to Modify Captured Variables
- Rebuilds bucket structures
- (linked lists or trees) as needed
- Lesson 1128 — Recalculating Hash Indices After Resizing
- Receives
- tasks submitted via the Executor interface
- Lesson 2712 — Thread Pools: Reusing Threads for Efficiency
- Recoloring
- flips node colors (red ↔ black) to restore rule compliance, often combined with rotations.
- Lesson 1137 — Red-Black Tree Internals: Balancing Operations
- recoverable conditions
- that the calling code should be prepared to handle.
- Lesson 784 — What Makes an Exception Checked?Lesson 789 — When to Use Checked Exceptions: Recoverable ConditionsLesson 812 — Choosing Between Checked and Unchecked
- Recovery code
- What to do when this exception occurs
- Lesson 730 — The catch Block: Handling Specific Exception Types
- Recovery strategies differ
- If calling code needs to handle different business errors distinctly, custom types make sense
- Lesson 821 — Best Practices: Avoiding Exception Overuse
- Recursive case
- The method calls itself with a simpler or smaller input, moving toward the base case
- Lesson 224 — What is Recursion? A Method Calling ItselfLesson 227 — Example: Computing Factorial Recursively
- Recursive traversal
- For each module encountered, parse its `module-info.
- Lesson 2470 — Module Graph and Dependencies at Runtime
- Recursively resolves
- all `requires` directives, adding modules to the graph
- Lesson 2476 — The Readability Graph
- red-black tree
- a self-balancing binary search tree.
- Lesson 995 — TreeSet: Sorted Set with Red-Black TreeLesson 999 — TreeMap: Sorted Map with Ordered KeysLesson 1066 — What is TreeSet? Sorted Set FundamentalsLesson 1117 — Red-Black Trees: The Data Structure Behind Tree BinsLesson 1132 — TreeMap Overview: Sorted Map ImplementationLesson 1137 — Red-Black Tree Internals: Balancing Operations
- Reduce coupling
- between classes (they depend on less)
- Lesson 722 — Default to Most Restrictive: The Principle of Least Privilege
- Reduce the problem size
- Make progress toward the base case
- Lesson 226 — The Recursive Case: Breaking Down the Problem
- Reduced errors
- No need to understand every thread pool parameter upfront
- Lesson 2719 — The Executors Factory Class Overview
- Reduces bugs
- Variables can't be accidentally modified outside their intended context
- Lesson 193 — Best Practices for Variable Scope
- Reduces resource consumption
- Bounded number of threads
- Lesson 2712 — Thread Pools: Reusing Threads for Efficiency
- Redundant service calls
- Calling multiple replicas of the same service and using whichever responds fastest
- Lesson 2767 — Use Cases: invokeAll vs invokeAny
- Reentrancy
- means a lock can be acquired *multiple times* by the *same thread* that currently holds it.
- Lesson 2671 — What Is Reentrancy?Lesson 2672 — Intrinsic Locks Are Reentrant by Default
- reentrant
- .
- Lesson 2675 — Recursive Calls in Synchronized MethodsLesson 2676 — Reentrancy Across Multiple Synchronized BlocksLesson 2678 — Reentrancy and Inheritance: Calling super MethodsLesson 2679 — Practical Example: Reentrant Lock in Action
- Refactor if needed
- If you later discover you need another bound, add it then—don't guess ahead of time
- Lesson 927 — Common Pitfalls: Overly Restrictive Bounds
- Refactoring becomes risky
- Renaming classes, methods, or fields can break reflective code without warning
- Lesson 2396 — Maintaining Code with Reflection
- Refactoring protection
- When a superclass method signature changes, the compiler alerts you immediately
- Lesson 2414 — Built-In Annotations: When and Why to Use Each
- Refactoring safety
- IDEs can rename all uses of `SHIPPED` reliably; renaming a magic number is error-prone.
- Lesson 578 — What Are Enums and Why They Matter
- reference
- (the memory address pointing to the object), not the object itself.
- Lesson 198 — Pass-by-Value Semantics in JavaLesson 296 — Stack vs Heap: References and Objects
- Reference Equality (`==`)
- Checks if two references point to the *exact same object* in memory—like asking "Are these two variables pointing to the same box?
- Lesson 541 — The equals Method: Reference vs Logical Equality
- Reference returned
- `new` returns a reference to the newly created object
- Lesson 313 — Creating Objects: Using new with Constructors
- reference type
- determines which methods you can call, not the actual object type.
- Lesson 441 — Method Availability After UpcastingLesson 461 — Method Resolution Process OverviewLesson 465 — The Role of the Reference Type at Compile Time
- Reference types
- (objects, including `String`): `null`
- Lesson 237 — Default Initialization ValuesLesson 241 — Arrays of Reference TypesLesson 282 — Arrays: Reference Types with Special SyntaxLesson 307 — Field Initialization: Default ValuesLesson 350 — Default Values for Uninitialized FieldsLesson 958 — Cannot Instantiate Generic Types with PrimitivesLesson 2322 — Using .class Literal Syntax
- Reference variables
- (any object type, including arrays and `String`) default to **`null`**.
- Lesson 280 — Default Values: Primitives vs References
- reflection
- behind the scenes to inspect your object's fields, discover their types, and write them to the stream.
- Lesson 2153 — Performance Benefits of ExternalizableLesson 2320 — What is the Class Object?Lesson 2453 — Compile-Time vs Runtime Annotation ProcessingLesson 2491 — opens vs exports: Key Differences
- Reflection overhead
- Every call to `getAnnotation()` requires metadata lookup, type instantiation, and proxy creation
- Lesson 2441 — Retention Policy and Performance Implications
- Reflection preparation
- The `Class` object is the gateway to Java's reflection capabilities (advanced topic)
- Lesson 571 — The getClass Method: Runtime Type Information
- Reflection-friendly
- All packages are open for deep reflection
- Lesson 2515 — Modular JARs vs Non-Modular JARs at Runtime
- Reflexive
- Lesson 289 — Overriding equals: The Contract and RulesLesson 542 — Overriding equals: The Five Requirements
- Reflexivity
- An object equals itself: `p1.
- Lesson 1093 — Testing Your equals and hashCode Implementations
- Reformatting
- Join processed lines with different delimiters
- Lesson 2224 — Combining lines with Stream Operations
- Regular import
- Brings a *class* into scope so you don't need the package name
- Lesson 376 — Understanding static Import Syntax
- reified
- they remember their component type at runtime and check every element assignment.
- Lesson 897 — Cannot Create Generic ArraysLesson 1500 — Common Pitfalls with toArray(Object[]::new)
- Reinsert the entry
- into the appropriate bucket in the new array
- Lesson 1126 — The Rehashing Process: Doubling Capacity
- Relational operators
- `<`, `>`, `<=`, `>=` — comparisons
- Lesson 112 — Chaining Comparisons and Operator Precedence
- Relative paths
- specify a location relative to some starting point (usually the current working directory).
- Lesson 2027 — Absolute vs Relative Paths
- released
- automatically when:
- Lesson 2654 — Acquiring and Releasing the LockLesson 2662 — Intrinsic Locks and Monitor Objects
- Releases system resources
- (file handles, sockets)
- Lesson 1911 — The close() Method and Stream LifecycleLesson 1921 — Flushing and Closing: flush() and close() Methods
- Reliability
- The classpath allows duplicate classes and missing dependencies to fail at runtime.
- Lesson 2517 — Module Path Introduction: A New Way to Organize Code
- Reliable configuration
- Missing dependencies are detected at compile-time and startup, not randomly at runtime.
- Lesson 2461 — Introduction to JPMS and the Module System
- Remember
- `super(args)` must be the **first statement** in the constructor, just like `this()`.
- Lesson 408 — Calling Specific Superclass Constructors with super(args)Lesson 2297 — Predefined Character Classes: \d, \w, \s
- Removal methods
- Lesson 1168 — Queue Core Methods: add, offer, remove, poll
- Remove `final`
- Enable deep copying but lose immutability guarantees
- Lesson 569 — Final Fields and clone: The Conflict
- Remove duplicate dots
- – Multiple consecutive dots collapse to one
- Lesson 2537 — Automatic Module Naming from JAR Filename
- Remove flags incrementally
- as you refactor code
- Lesson 2530 — Using --add-exports and --add-opens as Temporary Workarounds
- Remove leading/trailing dots
- – Clean up the edges
- Lesson 2537 — Automatic Module Naming from JAR Filename
- Remove operations fail
- Even though an element is logically present, `remove()` can't find it.
- Lesson 558 — HashSet Breakage: The Same Root Cause
- Remove the `.jar` extension
- – `commons-lang3-3.
- Lesson 2537 — Automatic Module Naming from JAR Filename
- Remove wildcard imports
- import specific members instead of `import static Math.
- Lesson 380 — Name Conflicts and Ambiguity in static Imports
- Removing a field
- The serialized stream contains data for a field that no longer exists in the class.
- Lesson 2128 — Removing or Renaming Fields: Breaking Changes
- Removing elements
- Lesson 600 — EnumSet Operations: Add, Remove, and Bulk ModificationsLesson 972 — Deque Interface: Double-Ended Queue OperationsLesson 1167 — Queue Interface Overview and FIFO Semantics
- Removing fields
- Old serialized data contains fields the new class doesn't recognize
- Lesson 2164 — Versioning Problems and Class Evolution
- Rename methods
- if overloading becomes too complex
- Lesson 215 — Common Overloading Pitfalls and Ambiguity
- Renaming a field
- Java sees the old field name in the stream but can't find it in the current class.
- Lesson 2128 — Removing or Renaming Fields: Breaking Changes
- Repeat
- until start >= end (they cross or meet)
- Lesson 1230 — Reverse Internals: How Swapping WorksLesson 2526 — The Bottom-Up Migration Strategy
- Repeated pagination
- Multiple queries with increasing offsets waste work
- Lesson 1469 — Performance Implications of skip
- Replace
- the internal reference to point to the new array
- Lesson 1008 — System.arraycopy: The Reallocation MechanismLesson 2163 — The readResolve Method for Singleton Protection
- Replace Types Systematically
- Lesson 1903 — Migration Checklist and Common Pitfalls
- Represent historical data
- where the offset at that moment is what counts, not future rule changes
- Lesson 1867 — Introduction to OffsetDateTime
- Reproducibility
- Use the same random "seed" to get identical shuffles every time (great for testing or debugging)
- Lesson 1232 — Providing a Custom Random Source to shuffle
- Request arrives
- → Store context in `ThreadLocal`
- Lesson 2639 — Common Use Cases: User Context and Request Scoping
- Request completes
- → **Always** call `remove()` to prevent leaks
- Lesson 2639 — Common Use Cases: User Context and Request Scoping
- Required
- When the literal exceeds `int` range (larger than 2,147,483,647 or smaller than -2,147,483,648)
- Lesson 57 — Long Literals and the L SuffixLesson 559 — The equals-hashCode Contract in DetailLesson 1675 — BiFunction apply Method and Lambda Syntax
- Requires public no-arg constructor
- Additional constraint
- Lesson 2157 — Externalizable vs Serializable: Trade-offs and Decision Guide
- Reset singletons
- Clear private static fields between tests
- Lesson 2390 — Testing: Accessing Private Members
- Resource availability
- If a resource is locked or unavailable, the caller might wait and retry or queue the operation for later.
- Lesson 789 — When to Use Checked Exceptions: Recoverable Conditions
- Resource Cleanup
- Lesson 2624 — Daemon Thread Limitations and Risks
- Resource control
- Limit concurrency for database queries or API calls by using a bounded thread pool.
- Lesson 2803 — Using thenApplyAsync with Custom Executor
- Resource Exhaustion
- Imagine a web server that spawns a thread per request.
- Lesson 2709 — The Problem with Manual Thread Management
- Resource isolation
- Keep heavy tasks separate from lightweight ones
- Lesson 2864 — Passing Custom Executors to Async MethodsLesson 2870 — Best Practices: When to Use Custom vs Default Executors
- Resource management
- When you need threads back for other work
- Lesson 2742 — get() with Timeout: Avoiding Indefinite Blocking
- Resource Release
- The method must release all resources held by the object—file handles, network connections, database connections, etc.
- Lesson 823 — The close() Method Contract
- Resource scheduling
- The JVM scheduler or OS may favor certain threads over others
- Lesson 2705 — What Is Starvation?
- Resources are closed
- automatically (in reverse order of declaration)
- Lesson 835 — Combining Try-With-Resources and Finally
- Responsive user interfaces
- Keep your UI responsive while performing background work.
- Lesson 2560 — When to Use Threads in Java
- Result in output.txt
- Lesson 2018 — print and println Methods
- rethrowing
- .
- Lesson 766 — Why Rethrow: When to Propagate ExceptionsLesson 767 — Basic Rethrow: throw in catch Block
- Retry
- with a longer timeout or different strategy
- Lesson 2754 — Timeout-Based Result Retrieval with get(timeout)
- Return
- a new wrapped result (Stream or CompletableFuture)
- Lesson 2805 — thenApply vs map in Stream API
- Return statements
- What return type does the method signature declare?
- Lesson 1727 — What Is Target Typing?
- return type
- that tells you what kind of value (if any) the method gives back to the code that called it.
- Lesson 195 — Return Types: void vs Value-Returning MethodsLesson 1757 — Optional as a Container for Possibly-Absent ValuesLesson 1768 — Optional is Not SerializableLesson 1820 — Anti-Pattern: Optional as Method ParametersLesson 1821 — Anti-Pattern: Optional Fields in ClassesLesson 2119 — writeObject() and readObject() Method SignaturesLesson 2836 — Basic exceptionally Syntax and Return TypeLesson 2854 — CompletableFuture.allOf: Waiting for All Tasks
- Return value matters
- Always check how many bytes were actually skipped—it might be fewer than you requested
- Lesson 1910 — The skip(long) Method for Skipping Bytes
- Return-value methods
- (`offer`, `poll`) are polite: "Is there a table available?
- Lesson 1168 — Queue Core Methods: add, offer, remove, poll
- Returns
- the element that was at the current position before advancing
- Lesson 1276 — next(): Retrieving the Next ElementLesson 2201 — The replace Method: Replacing Characters
- Returns a new future
- You get a `CompletableFuture` of the transformed type
- Lesson 2797 — What thenApply Does: Synchronous Transformation
- Returns a reference
- (a memory address) pointing to that newly allocated space
- Lesson 276 — The new Keyword: Allocating Objects on the HeapLesson 295 — Object Allocation with new
- returns a value
- that you can assign directly!
- Lesson 149 — Switch Expressions (Java 12+): Arrow SyntaxLesson 1667 — Lambda Syntax for Suppliers
- Returns to `methodB()`
- and checks if it has a matching `catch` block
- Lesson 750 — Exception-Driven Stack Unwinding
- Returns true or false
- `true` if the element was new (put returned `null`), `false` if it was already present (put returned `PRESENT`)
- Lesson 1049 — HashSet add: Calling HashMap put
- Reusability
- Other packages or projects might need this class independently
- Lesson 619 — Static Nested Classes vs Top-Level ClassesLesson 1425 — Chaining Multiple filter OperationsLesson 1481 — Composing Multiple filter OperationsLesson 1623 — When to Write Custom Collectors vs Compose Existing OnesLesson 1645 — Predicates for Validation and Business RulesLesson 2572 — Creating a Thread with Runnable
- Reuse existing logic
- from one interface without rewriting it
- Lesson 500 — Using super to Call Specific Default Method
- Reuse first
- If an idle thread is available, it executes the task immediately
- Lesson 2723 — newCachedThreadPool: Elastic Thread Pool for Short Tasks
- reverse
- order or **preserve** order.
- Lesson 1218 — Stack vs Queue Trade-offs in Problem SolvingLesson 1237 — Combining Reverse, Shuffle, and Rotate in Algorithms
- reverse order
- of their declaration.
- Lesson 844 — Suppression OrderLesson 852 — Try-With-Resources: Automatic CleanupLesson 1451 — sorted with Custom ComparatorsLesson 1947 — Multiple Resources in Try-With-Resources
- Reverse the entire list
- Lesson 1236 — Rotate Internals: Reversal Algorithm
- Reverse the remaining elements
- Lesson 1236 — Rotate Internals: Reversal Algorithm
- Richer Metadata Access
- You can retrieve detailed file attributes, permissions, ownership, and timestamps with ease.
- Lesson 2034 — Overview of Files Utility Class and Basic Operations
- Right rotation (positive distance)
- Elements near the end move to the front.
- Lesson 1234 — Collections.rotate: Shifting Elements Circularly
- Right side of arrow
- The body—what the lambda does or returns
- Lesson 1699 — Lambda Expression Structure: Arrow Notation
- Right-click in your class
- (or use a keyboard shortcut)
- Lesson 347 — IDE Generation and Refactoring Tools for Accessors
- Risk of OutOfMemoryError
- with very large datasets
- Lesson 1448 — Performance Implications of distinct on Large Streams
- Room
- Generates database access code from entity annotations
- Lesson 2452 — What Are Annotation Processors?
- root cause
- of your problem.
- Lesson 771 — Rethrowing in finally: Suppressing Original ExceptionsLesson 1944 — The Problem with close() in finally: Exception Suppression
- root directory
- of your JDK installation—the folder that contains subdirectories like `bin`, `lib`, and `include`.
- Lesson 5 — Setting the JAVA_HOME Environment VariableLesson 664 — Running Packaged Classes
- Root elements
- `getRootElements()` gives you all top-level types being compiled this round
- Lesson 2457 — The RoundEnvironment and Processing Rounds
- Root identification
- The module containing your main class becomes the root
- Lesson 2470 — Module Graph and Dependencies at Runtime
- Rotations
- restructure the tree by pivoting nodes.
- Lesson 1137 — Red-Black Tree Internals: Balancing Operations
- Round 1
- The compiler invokes your processor with all initial source files.
- Lesson 2457 — The RoundEnvironment and Processing Rounds
- Round 2+
- If new files were generated, the compiler processes them and calls your processor again with the newly created elements.
- Lesson 2457 — The RoundEnvironment and Processing Rounds
- Round status
- `processingOver()` tells you if this is the final round
- Lesson 2457 — The RoundEnvironment and Processing Rounds
- rules
- Java enforces at compile time.
- Lesson 471 — The Rules of CovarianceLesson 1855 — ZoneOffset vs ZoneId: Fixed vs Region-Based
- RUNNABLE
- – The thread is eligible to run.
- Lesson 2580 — Thread States Overview: The Five-State ModelLesson 2582 — RUNNABLE State: Ready to Execute
- running
- and consuming CPU cycles, but they're stuck in a repetitive pattern of activity.
- Lesson 2703 — Detecting Livelock vs DeadlockLesson 2774 — isShutdown() and isTerminated() Status Methods
- Running tasks finish
- tasks currently being processed run to completion
- Lesson 2715 — Graceful Shutdown: The shutdown Method
- runtime
- .
- Lesson 463 — Static vs Dynamic BindingLesson 902 — Type Safety: Compile-Time vs RuntimeLesson 2379 — Annotation Retention and Runtime AvailabilityLesson 2432 — What Are Retention Policies?Lesson 2491 — opens vs exports: Key Differences
- RUNTIME annotations
- are the only ones your reflection code can access using methods like `getAnnotation()`, `getDeclaredAnnotations()`, or `isAnnotationPresent()`.
- Lesson 2379 — Annotation Retention and Runtime Availability
- Runtime errors
- (also called **exceptions**) are problems that occur *while your program is executing*.
- Lesson 15 — Understanding Runtime Errors
- Runtime processing
- Happens while your application is executing (using reflection)
- Lesson 2453 — Compile-Time vs Runtime Annotation Processing
- Runtime type checking
- – validating parameters and target classes
- Lesson 2378 — Performance and Security Considerations
S
- Safe for downstream operations
- – you can immediately use the result in calculations
- Lesson 1594 — Handling Empty Streams with Summing and Averaging Collectors
- Safe reentrancy
- The thread maintains exclusive access through nested calls
- Lesson 2674 — Lock Acquisition Count: Entry and Exit Tracking
- Safer exception handling
- Properly preserves original exceptions using suppressed exception mechanism
- Lesson 829 — Why AutoCloseable Matters
- Safety
- You can prevent dangerous operations from executing.
- Lesson 140 — Short-Circuit Evaluation: Efficiency and SafetyLesson 345 — Read-Only Properties: Getters Without SettersLesson 2349 — Type Safety and IllegalArgumentException Risks
- same
- .
- Lesson 117 — The Bitwise XOR Operator (^)Lesson 1222 — Collections.binarySearch on Sorted ListsLesson 1522 — Why collect Is the Gateway to Advanced Collectors
- Same Class
- | **Same Package** | **Subclass** | **Everywhere** |
- Lesson 335 — Comparing Access Levels: A Decision Matrix
- same name
- but **different parameter counts**.
- Lesson 208 — Overloading by Parameter CountLesson 873 — Common Pitfalls: Type Parameter Shadowing
- Same neighborhood (package)
- Everyone can visit your house
- Lesson 706 — Protected Members and Package Boundaries
- same object
- in the intern pool, not two separate objects.
- Lesson 2176 — What is the String Intern Pool?Lesson 2655 — Only One Thread Executes at a TimeLesson 2658 — Mixing synchronized and Non-synchronized Methods
- same order
- as successive `poll()` calls would retrieve them.
- Lesson 1173 — Queue Iteration Order and Iterator BehaviorLesson 2144 — Reading Additional Data in readObjectLesson 2145 — Maintaining Read/Write Symmetry
- same package
- , but invisible to classes in different packages.
- Lesson 328 — Package-Private (Default) AccessLesson 335 — Comparing Access Levels: A Decision MatrixLesson 704 — Package-Private (Default) Access Across PackagesLesson 768 — Rethrowing the Same Exception Instance
- same type
- using commas:
- Lesson 168 — Multiple Variables in for Loop Initialization and UpdateLesson 1510 — The Three-Argument reduce: Handling Different TypesLesson 2836 — Basic exceptionally Syntax and Return Type
- Same type safety
- The compiler still enforces types strictly
- Lesson 859 — Diamond Operator: Type Inference in Constructors
- Save
- scores to a file for persistence (requires `Serializable`)
- Lesson 925 — Use Case: Combining Comparable and Serializable
- Save an object's state
- to a file so it persists after your program closes?
- Lesson 2103 — What Is Serialization and Why It Matters
- Scalability
- Applications can ship with only the JDK modules they need, reducing footprint dramatically.
- Lesson 2461 — Introduction to JPMS and the Module System
- Scales to zero
- When no tasks arrive, the pool eventually shrinks to zero threads
- Lesson 2723 — newCachedThreadPool: Elastic Thread Pool for Short Tasks
- Scatter
- Launch multiple threads to work on independent tasks simultaneously
- Lesson 2616 — Common join Patterns: Scatter-Gather
- Scenario 1
- Exception in try block + exception in `close()` = close exception suppressed
- Lesson 840 — When Suppression Occurs
- Scenario 1: Non-Comparable Type
- Lesson 1072 — ClassCastException: When Elements Aren't Comparable
- Scenario 2
- No exception in try block + exception in `close()` = close exception propagates normally (no suppression)
- Lesson 840 — When Suppression Occurs
- Scenario 3
- Multiple resources, exceptions in multiple `close()` calls + exception in try block = all close exceptions suppressed
- Lesson 840 — When Suppression Occurs
- Scheduler granularity
- Operating systems often schedule in time slices (e.
- Lesson 2596 — Sleep Precision and Guarantees
- Searching for specific zones
- Lesson 1853 — Getting Available Time Zone IDs
- Second `awaitTermination()`
- verifies forced shutdown actually worked
- Lesson 2775 — Common Shutdown Patterns and Best Practices
- Second downstream collector
- – computes another result (e.
- Lesson 1609 — Basic teeing Example: Min and Max in One Pass
- Second parameter
- (`s2`) becomes the *argument* to `equals`
- Lesson 1742 — Method References vs Lambda Parameter OrderLesson 2844 — The handle Method: Signature and Purpose
- secondary hashing
- (also called hash spreading) first.
- Lesson 1105 — Hash Spreading: Secondary HashingLesson 1108 — put() Operation: Insertion Process
- Seconds
- since the epoch (positive for after 1970, negative for before)
- Lesson 1827 — What is Instant? Epoch Time RepresentationLesson 1838 — LocalTime: Representing Time Without Date
- Security
- Preventing subclassing ensures no one can override behavior in ways that might compromise the class's guarantees.
- Lesson 427 — The final Keyword on ClassesLesson 1232 — Providing a Custom Random Source to shuffleLesson 2484 — Multiple Qualified exports for Fine-Grained ControlLesson 2544 — What is jlink and Why Custom Runtime Images Matter
- Security checks
- Access control verification happens each time
- Lesson 2350 — Performance Costs of Reflective InvocationLesson 2378 — Performance and Security ConsiderationsLesson 2395 — Performance Overhead of ReflectionLesson 2397 — Why Reflection Is Slower Than Direct Access
- Security concerns
- Deserializing untrusted data creates vulnerability risks.
- Lesson 2111 — When to Use and Avoid Serialization
- Security permission checks
- (when SecurityManager is present)
- Lesson 2400 — setAccessible and Security Manager Overhead
- Security risks
- Java's security model trusts that a `String` behaves like a `String`.
- Lesson 429 — final Classes in the JDK: String and Wrappers
- Security violations
- You can modify `final` fields, change security credentials, or alter immutable objects
- Lesson 2360 — Performance and Security Implications of Field Access
- Security vulnerabilities
- can arise from finalization attacks
- Lesson 577 — Deprecation of finalize in Java 9+
- SecurityManager
- (legacy) and the **module system** (modern) can block this power when security policies demand it.
- Lesson 2365 — Security Manager and Module System RestrictionsLesson 2400 — setAccessible and Security Manager Overhead
- Seed
- The initial value (where your sequence starts)
- Lesson 1378 — Stream.iterate() with Seed and UnaryOperatorLesson 1379 — Bounded iterate() with Predicate (Java 9+)
- Self-closing tags
- Lesson 2290 — HTML Tag Matching and Extraction
- Self-synchronizing
- You can detect character boundaries even if you jump into the middle of a stream
- Lesson 2000 — UTF-8: Variable-Length Encoding
- semicolon
- instead of `{ }`
- Lesson 480 — Abstract Method Syntax and RulesLesson 579 — Basic Enum Declaration SyntaxLesson 1947 — Multiple Resources in Try-With-Resources
- Sensible defaults
- Thread pools configured for typical use cases
- Lesson 2719 — The Executors Factory Class Overview
- sentinel value
- is a special input that signals "stop processing.
- Lesson 161 — Sentinel Values and Input Validation LoopsLesson 2200 — Handling indexOf Return Value: -1 for Not Found
- Sentinel value patterns
- Lesson 157 — Writing Effective while Loop Conditions
- Separate concerns
- Keep background logging tasks isolated from critical business logic
- Lesson 2791 — Providing a Custom Executor to runAsync
- Separate with pipes
- Use `|` between exception types, not commas
- Lesson 761 — Multi-Catch Syntax (Java 7+)
- Separation of concerns
- `Runnable` cleanly separates the *task* from the *thread execution mechanism*.
- Lesson 2569 — Thread vs Runnable: Design Trade-offsLesson 2572 — Creating a Thread with Runnable
- sequence
- and **order of processing**.
- Lesson 1167 — Queue Interface Overview and FIFO SemanticsLesson 1487 — Operation Order and Performance
- sequential
- , meaning elements are processed one after another in encounter order (for ordered collections like List).
- Lesson 1384 — stream() Method on CollectionsLesson 1507 — Identity Element Requirements: Associativity and Neutrality
- Sequential access
- means reading or writing bytes in consecutive order from start to finish.
- Lesson 1954 — Disk I/O Latency and Sequential vs Random AccessLesson 2074 — DirectoryStream Interface Overview
- Sequential composition
- with `thenCompose` executes operations in order—the second stage *waits* for the first to complete before starting.
- Lesson 2824 — Performance Considerations: Sequential vs Parallel Composition
- Sequential processing
- is acceptable for your use case
- Lesson 1542 — findFirst: Deterministic Element Selection
- sequential streams
- , short-circuiting operations respect encounter order:
- Lesson 1418 — Ordering and Short-Circuiting: Parallel StreamsLesson 1543 — findAny: Non-Deterministic Selection for PerformanceLesson 1545 — findFirst vs findAny in Sequential Streams
- sequentially
- they process elements one at a time in a single thread, just like a traditional loop.
- Lesson 1372 — Sequential vs Parallel StreamsLesson 2829 — thenCombine vs thenCompose: Key Differences
- Serializable (default)
- Someone examines each item, decides how to pack it, writes notes about what it is, then carefully places it.
- Lesson 2153 — Performance Benefits of Externalizable
- Serializable (Often Required)
- Lesson 342 — JavaBeans Naming Conventions Overview
- Serialization
- Libraries need to call getters/setters on arbitrary objects
- Lesson 2341 — Overview of Method.invoke and Its PurposeLesson 2438 — RetentionPolicy.RUNTIME Explained
- Serialization libraries
- (Jackson, Gson) must read/write private state
- Lesson 2492 — Unconditional opens: Opening Packages to All Modules
- Server applications
- Handle multiple client requests simultaneously.
- Lesson 2560 — When to Use Threads in Java
- Server programs
- waiting for client connections indefinitely
- Lesson 169 — Omitting for Loop Components: Infinite Loops
- Serves as documentation
- Makes your design explicit
- Lesson 1636 — When @FunctionalInterface is Optional
- Service Provider Interface (SPI)
- is a design pattern where an **interface** (or abstract class) is defined by one module, but **implementations** are discovered and loaded dynamically at runtime from other modules.
- Lesson 2498 — The Service Provider Interface (SPI) Pattern
- ServiceLoader
- is built into the JDK and uses module descriptors (`uses` and `provides.
- Lesson 2507 — Service Loading vs Traditional Dependency Injection
- Services provided
- (from `provides.
- Lesson 2510 — Inspecting Modular JAR Contents with jar --describe-module
- Services used
- (from `uses` directives)
- Lesson 2510 — Inspecting Modular JAR Contents with jar --describe-module
- Set
- Lesson 979 — List vs Set vs Map: The Fundamental DecisionLesson 1574 — Collecting to Different Collection Types per Group
- Set thread priorities
- Ensure critical tasks get CPU time
- Lesson 2866 — Why Custom Executors Matter: Isolation and Resource Control
- Sets
- to eliminate duplicates within each partition
- Lesson 1585 — Collecting to Different Data Structures per Partition
- Setters
- (`setFieldName(value)`) let others *write* a field's value with validation
- Lesson 338 — The Purpose of Getters and SettersLesson 723 — Prefer private Fields with Controlled Public Methods
- Setting flags
- (turning bits on) uses the `|` operator:
- Lesson 123 — Practical Uses: Bit Flags and Masking
- Shadowing
- occurs when a variable in an inner scope has the same name as a variable in an outer scope.
- Lesson 637 — Scope and Shadowing in Local ClassesLesson 2487 — Package Splitting and exports: Avoiding Conflicts
- shadows
- (hides) the outer class field.
- Lesson 629 — Shadowing and Name Resolution in Inner ClassesLesson 720 — Shadowing Fields and Access Control
- shallow copy
- a new object with the same field values
- Lesson 561 — The Cloneable Interface and Object.cloneLesson 564 — Shallow Copy Problem: Shared ReferencesLesson 2057 — Copying Directories vs Files
- Shared Memory
- Multiple threads within the same process can access the same variables, objects, and heap memory.
- Lesson 2554 — Thread: A Lightweight Execution Unit
- Shared Memory Space
- Threads within a process share the same memory address space.
- Lesson 2559 — Context Switching Costs
- Shared state is essential
- Subclasses need common fields (instance variables)
- Lesson 525 — Abstract Classes: Is-A with Shared Implementation
- Shared utility
- Serves both static and default methods
- Lesson 522 — Private Static Methods in Interfaces
- Ship it
- Users extract and run—no JRE installation needed
- Lesson 2551 — Distributing Custom Runtime Images
- Short bucket chains
- With good hash distribution and proper load factor, most buckets contain 0-1 elements
- Lesson 1112 — Performance Characteristics: O(1) Average Case
- short-circuit evaluation
- .
- Lesson 110 — Short-Circuit Evaluation in && and ||Lesson 140 — Short-Circuit Evaluation: Efficiency and Safety
- short-circuiting
- when combined with short-circuiting terminal operations.
- Lesson 1426 — Performance Characteristics of filterLesson 1463 — Understanding limit: Taking First N ElementsLesson 1532 — Understanding Match Operations OverviewLesson 1534 — Short-Circuiting Behavior of anyMatchLesson 1535 — allMatch: Testing If All Elements Match
- Short-circuiting intermediate operations
- Transform the stream and can limit its size
- Lesson 1411 — What Are Short-Circuiting Operations?Lesson 1478 — Performance Characteristics and Short-Circuiting
- Short-circuiting terminal operations
- Produce results without necessarily processing all elements
- Lesson 1411 — What Are Short-Circuiting Operations?
- short-circuits
- the entire pipeline.
- Lesson 1465 — Short-Circuiting Behavior of limitLesson 1533 — anyMatch: Testing If Any Element MatchesLesson 1537 — noneMatch: Testing If No Elements Match
- Short-lived computations
- that complete quickly
- Lesson 2781 — Async Execution Models: Common vs Custom Executors
- Short-term caching
- If you need to temporarily store objects in memory or on disk within the same application version, serialization works fine.
- Lesson 2111 — When to Use and Avoid Serialization
- Short, single-line strings
- Use simple concatenation or `formatted()`
- Lesson 2243 — Text Blocks vs String Concatenation
- Shutdown Capabilities
- Lesson 2711 — ExecutorService: Extended Lifecycle and Task Management
- Shutdown initiated
- No longer accepting new tasks, but still processing existing ones
- Lesson 2774 — isShutdown() and isTerminated() Status Methods
- side effects
- that break these guarantees.
- Lesson 1373 — Stream Operations Are Functional and Side-Effect FreeLesson 1488 — Understanding forEach as a Terminal OperationLesson 1657 — What is Consumer<T> and When to Use It
- Signature
- Lesson 1008 — System.arraycopy: The Reallocation MechanismLesson 1525 — Finding Minimum Elements with min(Comparator)Lesson 1807 — Optional.filter: Conditional PresenceLesson 1810 — The or Method: Providing Alternative Optionals
- Signature pattern
- Lesson 2815 — What is thenCompose and Why It Exists
- Silent failures
- Your `set()` call may succeed without throwing an exception, yet other parts of the program continue seeing the original value.
- Lesson 2357 — Final Fields: Modification Restrictions and Workarounds
- Simple applications
- Premature optimization—start with explicit passing
- Lesson 2641 — ThreadLocal Alternatives and When to Avoid It
- Simple identifier (variable name)
- Lesson 2301 — Quantifiers with Character Classes: Practical Patterns
- Simple patterns
- with few captures where position is obvious
- Lesson 2275 — Named Groups vs Numbered Groups
- Simple return values work
- Returning `null`, `-1`, or `Optional` is often clearer than throwing exceptions for normal "not found" scenarios
- Lesson 821 — Best Practices: Avoiding Exception Overuse
- Simple, short operations
- where the entire method needs exclusive access
- Lesson 2660 — When to Use Synchronized Methods
- Simplicity
- The relationship isn't strong enough to justify nesting
- Lesson 619 — Static Nested Classes vs Top-Level Classes
- Simplified (type inference)
- Lesson 2807 — thenAccept Signature and Lambda Usage
- Simplified deployment
- You distribute one self-contained package—no "Java version mismatch" issues.
- Lesson 2544 — What is jlink and Why Custom Runtime Images MatterLesson 2551 — Distributing Custom Runtime Images
- Simplifies code
- No more verbose `finally` blocks with nested try-catch
- Lesson 829 — Why AutoCloseable Matters
- Simplifies usage
- No need to create an object just to call the method
- Lesson 367 — Common Use Cases for static Methods: Utility Functions
- Simplifying APIs
- passing implicit context without adding parameters to every method call
- Lesson 2633 — What is ThreadLocal and Why It Exists
- Simulating delays or rate-limiting
- When testing concurrent behavior or avoiding overwhelming external systems (APIs, databases), you insert deliberate pauses between operations.
- Lesson 2590 — The Purpose of Thread.sleep
- Single catch (reassignment allowed)
- Lesson 763 — The Implicit final in Multi-Catch
- single inheritance
- .
- Lesson 394 — Single Inheritance in JavaLesson 437 — is-a and Multiple Inheritance Through Interfaces
- Single inheritance constraint
- A class can only extend one abstract class, even if it's empty.
- Lesson 530 — Marker Interfaces vs Empty Abstract Classes
- Single iteration
- The stream pipeline executes only once
- Lesson 1613 — Performance Benefits of teeing Over Multiple Passes
- single quotes
- Lesson 48 — The char Type: Representing Single CharactersLesson 49 — Character Literals and Escape SequencesLesson 60 — Character Literals and Escape Sequences
- Single quotes only
- `'A'` is a `char`, but `"A"` (double quotes) is something different you'll learn later.
- Lesson 48 — The char Type: Representing Single Characters
- Single static import
- brings in exactly one static member:
- Lesson 673 — Single Static Import vs Static Import on Demand
- Single static member import
- Lesson 672 — Static Import: Importing Static Members
- Single thread only
- → Migrate to `HashMap`
- Lesson 1158 — Migrating from Hashtable to Modern Alternatives
- Single vs multiple inheritance
- A class extends only one abstract class but can implement many interfaces.
- Lesson 513 — Default Methods and Abstract Classes
- Single-parameter interfaces
- work with one input:
- Lesson 1673 — Understanding Binary Functional Interfaces
- Single-statement (no braces)
- Lesson 2807 — thenAccept Signature and Lambda Usage
- Single-threaded context
- (99% of cases): Use `StringBuilder`
- Lesson 2194 — When to Use StringBuilder vs StringBuffer
- Single-use only
- Once you've processed a stream, it's consumed and cannot be reused.
- Lesson 1367 — Streams Are Not Data Structures
- Sink gadget
- A class that performs the dangerous action (file I/O, reflection, etc.
- Lesson 2159 — Gadget Chains and Object Injection
- size
- of the array—how many elements it contains.
- Lesson 236 — Creating Arrays with newLesson 1002 — Initial Capacity and the Default ConstructorLesson 1004 — The size vs capacity DistinctionLesson 1009 — trimToSize: Reclaiming Unused CapacityLesson 1011 — ArrayList's Internal Array and Capacity ConceptLesson 1013 — Triggering a Resize: When Capacity Is ExhaustedLesson 1059 — Capacity vs Size in HashSetLesson 1123 — Understanding Load Factor: Capacity vs Size
- Size computation
- Some collections compute size dynamically
- Lesson 1392 — Collection.stream() vs Arrays.stream() Performance Considerations
- Size reduction
- A full JRE can exceed 200 MB.
- Lesson 2544 — What is jlink and Why Custom Runtime Images Matter
- SKIP_SIBLINGS
- "Done with this floor, go upstairs"
- Lesson 2090 — FileVisitResult: Controlling Traversal Flow
- SKIP_SUBTREE
- "Don't open that closet, but check other rooms"
- Lesson 2090 — FileVisitResult: Controlling Traversal Flow
- Sliding Window Algorithms
- Lesson 1201 — When to Use Deque: Use Cases for Double-Ended Access
- Slow with frequent flush
- You're forcing too many disk syncs.
- Lesson 1958 — Profiling I/O Performance: Identifying Bottlenecks
- Small files
- Overhead of large buffers may outweigh benefits.
- Lesson 1952 — Buffer Size Selection and Throughput
- Small to moderate queues
- For queues with dozens to a few hundred elements where the performance difference is negligible and the familiar `LinkedList` API is comfortable.
- Lesson 1180 — When to Use LinkedList as a Queue
- Small, known vocabularies
- such as country codes, currency symbols, or protocol commands
- Lesson 2184 — Common Use Cases and Anti-patterns
- Smaller buffers
- Lesson 1981 — BufferedReader Buffer Size and Performance
- Smaller buffers (1KB–4KB)
- More frequent disk operations, lower throughput, but lower memory footprint.
- Lesson 1952 — Buffer Size Selection and Throughput
- Smaller footprint
- Only necessary modules included, not a full JDK
- Lesson 2551 — Distributing Custom Runtime Images
- Smaller payloads
- Binary formats like Protocol Buffers are often more compact
- Lesson 2165 — Alternatives to Java Serialization
- Smaller runtime footprint
- Since the JVM discards these annotations, your program uses slightly less memory
- Lesson 2436 — RetentionPolicy.CLASS Explained
- snapshot
- of the call stack at that precise moment.
- Lesson 753 — Stack Trace InformationLesson 2589 — Thread.getState() and Monitoring Thread States
- Snapshot-like
- Elements present when iteration began are guaranteed to be traversed exactly once
- Lesson 1307 — ConcurrentHashMap and Weakly Consistent Iterators
- Solaris
- Historically had robust priority mapping, but with its own quirks.
- Lesson 2629 — Platform-Dependent Priority Mapping
- Solution
- Use identity (`@hashCode`) for circular-prone references or limit depth:
- Lesson 537 — toString for Complex Objects: Nested ReferencesLesson 1327 — Common compareTo Mistakes and How to Avoid Them
- Sort
- scores by value (requires `Comparable`)
- Lesson 925 — Use Case: Combining Comparable and Serializable
- Sorted order
- Elements are automatically ordered (not insertion order!
- Lesson 1066 — What is TreeSet? Sorted Set FundamentalsLesson 1141 — TreeMap vs HashMap: When to Choose Sorted MapsLesson 1316 — TreeSet and TreeMap Rely on Comparable
- sorted streams
- , `takeWhile` and `dropWhile` excel at extracting ranges based on business logic:
- Lesson 1479 — Common Use Cases and PatternsLesson 1542 — findFirst: Deterministic Element Selection
- Sorted tree
- O(log n) — can eliminate half the remaining entries with each comparison
- Lesson 1118 — Comparable Keys and Tree Ordering
- Source
- Where the data comes from
- Lesson 1369 — The Stream Pipeline: Source, Intermediate, TerminalLesson 2328 — Checking Type Relationships with isAssignableFromLesson 2379 — Annotation Retention and Runtime AvailabilityLesson 2432 — What Are Retention Policies?
- SOURCE annotations
- are meant for compile-time tools (like `@Override` or `@SuppressWarnings`)—they guide the compiler but serve no purpose afterward.
- Lesson 2379 — Annotation Retention and Runtime Availability
- Space Complexity
- **O(1)**—only two pointer variables needed, no matter how large the list
- Lesson 1230 — Reverse Internals: How Swapping Works
- Space complexity is O(n)
- where n is the number of distinct elements
- Lesson 1448 — Performance Implications of distinct on Large Streams
- Space efficiency
- Common text uses far less space than fixed-width encodings
- Lesson 2000 — UTF-8: Variable-Length Encoding
- Special-value style
- The host politely says "Sorry, no availability right now" (returns false/null).
- Lesson 1171 — Exception-Throwing vs Returning-Special-Value Methods
- Special-value-returning methods
- Lesson 1171 — Exception-Throwing vs Returning-Special-Value Methods
- Specialized Branches
- Lesson 978 — Collections Hierarchy Diagram: Visualizing Relationships
- Specific Before General
- Lesson 765 — Catch Order Best Practices
- Speed
- Singleton collections are slightly faster for creation and access because there's no array initialization or bounds checking overhead.
- Lesson 1258 — Singleton vs Single-Element List Performance
- Spring and Dependency Injection
- Lesson 2368 — Legitimate Use Cases: Frameworks and Serialization
- Spring's Dependency Injection
- Spring scans your classes for annotations like `@Autowired`, `@Component`, or `@Service`.
- Lesson 2388 — Common Use Cases: Frameworks and Libraries
- Square extends Rectangle
- At first glance, this seems logical—a square is mathematically a type of rectangle.
- Lesson 436 — Violating is-a: Common Design Mistakes
- Stability
- means elements that compare as equal maintain their original relative order after sorting.
- Lesson 1336 — Comparator Stability and Equals Consistency
- stable
- if it preserves the original order of elements that compare as equal.
- Lesson 1221 — Sorting Stability and Implementation DetailsLesson 1363 — Stable vs Unstable SortingLesson 1364 — Sorting Performance Considerations
- stack
- as a bulletin board where you pin notes, and the **heap** as a warehouse where you store boxes.
- Lesson 296 — Stack vs Heap: References and ObjectsLesson 972 — Deque Interface: Double-Ended Queue OperationsLesson 1198 — Stack Methods: push, pop, and peekLesson 1216 — Depth-First Search with Deque StackLesson 2555 — Memory Isolation: Processes vs Threads
- Stack behavior
- (LIFO): `push()` and `pop()` operations
- Lesson 984 — Queue vs Deque: Choosing the Right End-Access Pattern
- Stack extends ArrayList
- You might think "a stack uses a list internally, so let's extend it!
- Lesson 436 — Violating is-a: Common Design Mistakes
- Stack growth
- `main` calls `methodA` (frame pushed), which calls `methodB` (frame pushed).
- Lesson 749 — Normal Stack Unwinding
- stack trace
- shows the sequence of method calls that led to a particular point in your program.
- Lesson 469 — Debugging Dynamic Dispatch with Stack TracesLesson 747 — Stack Traces and Debugging Propagated ExceptionsLesson 753 — Stack Trace Information
- StackOverflowError
- The call stack has exceeded its maximum depth, usually from infinite recursion (a method calling itself endlessly without a proper base case).
- Lesson 782 — VirtualMachineError and LinkageError: System-Level Errors
- Stale data is possible
- The iterator may show old data if the list was modified after iteration began
- Lesson 1306 — CopyOnWriteArrayList: A Fail-Safe Example
- Standard exceptions fit perfectly
- Use `IllegalArgumentException` for bad parameters rather than inventing `InvalidEmailException`
- Lesson 821 — Best Practices: Avoiding Exception Overuse
- Starting new projects
- where you control all dependencies and can define clean module boundaries from day one
- Lesson 2524 — Migration Strategy: When to Use Module Path vs Classpath
- Starvation
- occurs when a thread is perpetually denied access to shared resources it needs to make progress, even though it isn't technically blocked or stuck in a loop.
- Lesson 2705 — What Is Starvation?
- State (fields)
- Abstract classes can have instance variables with any access modifier.
- Lesson 513 — Default Methods and Abstract Classes
- State required
- You need fields or instance variables
- Lesson 649 — When to Prefer Lambdas Over Anonymous Classes
- stateful
- operation—it must see all elements before producing output
- Lesson 1360 — Sorting Streams with sorted(Comparator)Lesson 1380 — Stateful vs Stateless Stream GenerationLesson 1446 — Understanding distinct: Removing Duplicates from StreamsLesson 1464 — Understanding skip: Discarding First N Elements
- stateful operation
- it must maintain state about *all* elements before producing output.
- Lesson 1452 — The Stateful Nature of sortedLesson 1484 — Sorting Before limit
- stateless
- method doesn't rely on or modify any stored information (fields).
- Lesson 387 — Pure Functions and Statelessness in Utility ClassesLesson 1373 — Stream Operations Are Functional and Side-Effect FreeLesson 1380 — Stateful vs Stateless Stream GenerationLesson 1452 — The Stateful Nature of sorted
- Stateless utility functions
- (pure functions) make testing predictable because:
- Lesson 391 — Testing Utility Classes
- Statement block level
- Not directly supported, so use the smallest enclosing scope
- Lesson 2413 — @SuppressWarnings: Scope and Best Practices
- static
- (belongs to the class) or an **instance method** (belongs to each object created from the class).
- Lesson 205 — Static vs Instance Methods: When to Use thisLesson 358 — What static Means: Class-Level vs Instance-LevelLesson 466 — Hiding vs Overriding: Static Method BehaviorLesson 869 — Generic Methods in Non-Generic ClassesLesson 1626 — Default and Static Methods Are Allowed
- static binding
- (compile-time binding): Java decides which `static` method to call based on the *reference type* at compile time, not the actual object.
- Lesson 422 — static Methods Cannot Be OverriddenLesson 463 — Static vs Dynamic Binding
- static factory method
- that creates and returns a copy:
- Lesson 568 — When Not to Use clone: AlternativesLesson 1374 — Stream.of() for Fixed ElementsLesson 2854 — CompletableFuture.allOf: Waiting for All Tasks
- Static fields
- Accessed directly through the class
- Lesson 1722 — Capturing Instance Variables and Static FieldsLesson 2106 — Automatic Serialization of Instance FieldsLesson 2665 — Class-Level Locks with synchronized(ClassName.class)
- Static import
- Brings *static members* into scope so you don't need the class name
- Lesson 376 — Understanding static Import SyntaxLesson 377 — Importing Static Methods and Fields
- Static import on demand
- uses the wildcard `*` to import *all* static members from a class:
- Lesson 673 — Single Static Import vs Static Import on Demand
- Static imports
- let you skip the class name and use static fields and methods directly, as if they were declared in your own class:
- Lesson 376 — Understanding static Import SyntaxLesson 672 — Static Import: Importing Static Members
- static method
- belongs to the class itself, not to any particular object.
- Lesson 364 — Accessing Instance Members from static MethodsLesson 2232 — formatted vs String.formatLesson 2602 — Checking and Clearing: Thread.interrupted()Lesson 2657 — synchronized static Methods
- Static method predicates
- Lesson 1422 — Method References in filter
- Static method reference
- Lesson 654 — Method References as Further SimplificationLesson 1651 — Method References as Function ImplementationsLesson 1736 — Static Method References
- Static methods
- belong to the class itself, not to any particular object.
- Lesson 205 — Static vs Instance Methods: When to Use thisLesson 362 — Declaring static MethodsLesson 466 — Hiding vs Overriding: Static Method BehaviorLesson 503 — Static Methods Across Multiple InterfacesLesson 518 — Static Methods vs Default Methods: Key DifferencesLesson 626 — Accessing Outer Class Methods from Inner ClassesLesson 870 — Generic Static Methods: Utility Method Patterns
- static nested class
- is a class declared inside another class with the `static` modifier.
- Lesson 614 — What Are Static Nested Classes?Lesson 615 — Declaring and Instantiating Static Nested Classes
- Static references
- Lesson 301 — Memory Leaks in Java
- static synchronized methods
- (not yet covered), the lock belongs to the `Class` object itself.
- Lesson 2653 — The Implicit Lock (Monitor) of an ObjectLesson 2657 — synchronized static Methods
- Statistics
- Find the most or least common elements
- Lesson 1264 — Collections.frequency: Counting Element Occurrences
- Status Indicators
- Lesson 2686 — Common Use Cases: Status Flags and Control Variables
- Step 1: Field initialization
- Lesson 351 — Order of Initialization: Fields Before Constructor Body
- Step 2: Constructor body
- Lesson 351 — Order of Initialization: Fields Before Constructor Body
- Stick with classpath when
- Lesson 2524 — Migration Strategy: When to Use Module Path vs Classpath
- Stick with non-async when
- Lesson 2812 — Async Variants: thenAcceptAsync and thenRunAsync
- Stop running tasks
- If `mayInterruptIfRunning` is `true` **and** the task is already executing, the thread running it receives an interrupt signal.
- Lesson 2744 — cancel(): Attempting to Stop Running Tasks
- Stops accepting new tasks
- (just like `shutdown()`)
- Lesson 2716 — Forceful Shutdown: The shutdownNow Method
- Store in that bucket
- The key-value pair is placed in the chosen bucket.
- Lesson 554 — How HashMap Uses hashCode for Bucket Selection
- Store the element
- at index `size` in the backing array
- Lesson 1012 — The add Operation: Common Case Without Resize
- Store timestamps
- in databases where you care about the exact offset but not the time zone name
- Lesson 1867 — Introduction to OffsetDateTime
- Stores duplicates
- The second "equal" object goes into a different bucket, so `HashSet` doesn't detect it's a duplicate during `add()`
- Lesson 1086 — Breaking HashSet with Bad hashCode
- Storing a Consumer explicitly
- Lesson 1660 — Consumer in forEach: Iterating Collections
- Storing future events
- When you need to preserve the intended local time across potential time zone rule changes.
- Lesson 1856 — Best Practices: When to Use ZonedDateTime
- Storing Timestamps in Databases
- Lesson 1875 — Use Cases for OffsetDateTime
- Stream
- of values (not just one value).
- Lesson 1603 — flatMapping: Flattening Grouped StreamsLesson 2054 — Performance Comparison: readAllLines vs Streaming APIsLesson 2080 — DirectoryStream vs Files.list: When to Use Which
- Stream API operations
- (sorting, filtering chains, collectors)
- Lesson 2080 — DirectoryStream vs Files.list: When to Use Which
- Stream position advances
- After skipping, the next `read()` starts from the new position
- Lesson 1910 — The skip(long) Method for Skipping Bytes
- Stream processing
- You're processing data as a *stream* rather than a *collection*
- Lesson 2014 — Processing Large Files with readLine
- Stream sorting
- Lesson 1334 — Passing Comparators to Sort Methods
- Stream terminates
- The stream is consumed and cannot be reused
- Lesson 1488 — Understanding forEach as a Terminal Operation
- Strict is-a relationship
- A clear inheritance hierarchy exists (e.
- Lesson 532 — Decision Criteria: A Practical Checklist
- string
- in programming), you wrap it in double quotes:
- Lesson 16 — The System.out.println MethodLesson 1133 — Creating TreeMaps with Natural OrderingLesson 2324 — Using Class.forName() for Dynamic LoadingLesson 2425 — Element Types: Primitives, Strings, and Classes
- String concatenation
- Several *seconds* (with massive GC pressure)
- Lesson 2188 — Performance Comparison: String vs StringBuilderLesson 2243 — Text Blocks vs String Concatenation
- String concatenation approach
- Lesson 2188 — Performance Comparison: String vs StringBuilder
- String Intern Pool
- (also called the "string pool" or "string constant pool") is a special memory area maintained by the JVM that stores a single copy of each unique string literal.
- Lesson 2176 — What is the String Intern Pool?Lesson 2177 — String Literal Interning by Default
- String paths
- for simple, straightforward cases.
- Lesson 1969 — Creating FileReader Instances with File Paths
- String to Integer
- Lesson 1430 — Mapping to Different Types
- StringBuffer
- solve this by providing a **mutable character buffer** that grows as needed.
- Lesson 2185 — Why StringBuilder and StringBuffer Exist
- StringBuilder
- and **StringBuffer** solve this by providing a **mutable character buffer** that grows as needed.
- Lesson 2185 — Why StringBuilder and StringBuffer ExistLesson 2188 — Performance Comparison: String vs StringBuilderLesson 2243 — Text Blocks vs String Concatenation
- StringBuilder approach
- Lesson 2188 — Performance Comparison: String vs StringBuilder
- Strings and primitives
- Call the method directly, get the value
- Lesson 2384 — Extracting Annotation Element Values
- Strings are immutable
- every concatenation creates a new String object.
- Lesson 2185 — Why StringBuilder and StringBuffer Exist
- Strip version suffixes
- – Numbers and trailing separators at the end are removed: `commons-lang3-3.
- Lesson 2537 — Automatic Module Naming from JAR Filename
- strong encapsulation
- reflection shouldn't silently break guarantees that modules or security policies establish.
- Lesson 2365 — Security Manager and Module System RestrictionsLesson 2465 — Strong Encapsulation: Modules vs PackagesLesson 2468 — Module Descriptors and Accessibility RulesLesson 2469 — Unnamed Modules and CompatibilityLesson 2482 — Strong Encapsulation: What exports ProtectsLesson 2498 — The Service Provider Interface (SPI) PatternLesson 2507 — Service Loading vs Traditional Dependency InjectionLesson 2520 — Class Loading Differences: Modules vs Classpath (+1 more)
- Strong logical relationship
- The nested class exists primarily to support the outer class and rarely makes sense independently (like `Map.
- Lesson 619 — Static Nested Classes vs Top-Level Classes
- Stronger encapsulation
- Internal packages remain truly internal.
- Lesson 2461 — Introduction to JPMS and the Module SystemLesson 2488 — Best Practices: Minimizing Exported API Surface
- strongly encapsulated
- completely invisible and inaccessible to the outside world.
- Lesson 2480 — The exports Directive: Controlling Package VisibilityLesson 2492 — Unconditional opens: Opening Packages to All Modules
- Structural changes
- You didn't declare `serialVersionUID` at all, and Java's automatic computation produced different values due to class modifications
- Lesson 2125 — InvalidClassException: Version Mismatch Errors
- structure
- of that collection—you can't add, remove, or replace elements.
- Lesson 1243 — Nested Collections: Shallow ProtectionLesson 2269 — Non-Capturing Groups: (?:...)Lesson 2450 — ElementType.PACKAGE and MODULE
- Sub-second Precision
- Lesson 1890 — Pattern Symbols: Time Components (H, h, m, s, S, n, a)
- Subclass
- | **Everywhere** |
- Lesson 335 — Comparing Access Levels: A Decision MatrixLesson 393 — What Is Inheritance? The extends KeywordLesson 472 — Covariant Returns with Classes
- Subclassing is required
- – other classes must extend it to provide specific implementations
- Lesson 478 — The abstract Keyword for Classes
- Submit phase
- Loop through your tasks, calling `submit()` for each and storing the returned `Future` in a collection
- Lesson 2748 — Practical Pattern: Submitting Multiple Tasks and Collecting Results
- substitutability
- .
- Lesson 401 — Type Compatibility: Subclass Instances as Superclass ReferencesLesson 715 — Overriding and Access Levels: The Widening Rule
- Subtraction (-)
- Subtracts the right value from the left.
- Lesson 86 — The Five Basic Arithmetic Operators: +, -, *, /, %
- Subtraction is NOT associative
- .
- Lesson 1513 — Common Pitfalls: Non-Associative Operations and Side Effects
- Sum the values
- Lesson 1520 — Handling Duplicate Keys in toMap
- Summing collectors
- (`summingInt`, `summingLong`, `summingDouble`) return **0** (or 0L, 0.
- Lesson 1594 — Handling Empty Streams with Summing and Averaging Collectors
- superclass
- (or parent class), and the specialized class is called the **subclass** (or child class).
- Lesson 393 — What Is Inheritance? The extends KeywordLesson 400 — The Subclass Constructor and Implicit super()
- Superclass constructor executes first
- (triggered by `super()`)
- Lesson 407 — Constructor Chaining: The Initialization Sequence
- Supplier
- Creates the container (like getting an empty box)
- Lesson 1515 — The Three-Argument collect OverloadLesson 1518 — Collectors.toCollection() for Specific Collection TypesLesson 1616 — Supplier: Creating the Mutable Result ContainerLesson 1619 — Finisher: Transforming the Accumulator to Final ResultLesson 1629 — Common Functional Interfaces in java.util.functionLesson 1670 — Suppliers for Factory Patterns
- Surprise
- The indentation *looks* like both lines belong to the `if`, but Java only binds the first `println` to the condition.
- Lesson 137 — Block Statements vs Single Statements
- Switch
- from user space to kernel space (a context switch)
- Lesson 1953 — System Call Overhead and User vs Kernel Space
- switch expressions
- with a new arrow (`->`) syntax.
- Lesson 149 — Switch Expressions (Java 12+): Arrow SyntaxLesson 153 — Switch Expressions vs Statements: When to Use WhichLesson 611 — Switch Expressions with Enums (Java 14+)
- Symbolic link support
- First-class support for links and advanced file attributes
- Lesson 2025 — Introduction to NIO.2 and the Path Interface
- Symmetric
- Lesson 289 — Overriding equals: The Contract and RulesLesson 542 — Overriding equals: The Five Requirements
- symmetry
- if `a.
- Lesson 291 — equals with Inheritance: Challenges and SolutionsLesson 1093 — Testing Your equals and hashCode Implementations
- Symmetry means exact correspondence
- Every piece of data you write in `writeObject` must be read back in `readObject` in the **same order** and using the **same data type**.
- Lesson 2145 — Maintaining Read/Write Symmetry
- synchronized
- , meaning every method automatically locks the collection to ensure thread safety when multiple threads access it.
- Lesson 977 — Legacy Collection Classes: Vector and HashtableLesson 1153 — Hashtable vs HashMap: Key DifferencesLesson 2187 — StringBuffer: Thread-Safe String Building
- Synchronized blocks
- let you lock only part of a method and explicitly specify which object's lock to use.
- Lesson 2661 — Synchronized Blocks vs Synchronized Methods
- Synchronized wrappers
- Simple threading needs, occasional concurrent access, wrapping legacy collections
- Lesson 986 — Synchronized Collections vs Concurrent CollectionsLesson 1252 — Synchronized Wrappers vs Concurrent Collections
- Synchronous execution
- The transformation happens in the same thread that completes the prior stage
- Lesson 2797 — What thenApply Does: Synchronous Transformation
- Syntax
- Lesson 265 — Arrays.deepToString for Multidimensional ArraysLesson 377 — Importing Static Methods and FieldsLesson 628 — Qualifying this: OuterClass.thisLesson 663 — Compiling Packaged ClassesLesson 767 — Basic Rethrow: throw in catch BlockLesson 1263 — Comparing Factory Methods with Java 9+ Collection FactoriesLesson 1353 — Combining nullsFirst() with Custom ComparatorsLesson 1441 — flatMap with Optional: Avoiding Nested Optionals (+3 more)
- system call
- a request to the operating system to physically access the disk.
- Lesson 1932 — The Problem with Unbuffered I/O: System Call OverheadLesson 1951 — Unbuffered vs Buffered I/O: Performance ImpactLesson 1953 — System Call Overhead and User vs Kernel SpaceLesson 1977 — Why Buffering Matters for Character I/O
- System load
- Heavy CPU usage means more threads competing for execution time
- Lesson 2596 — Sleep Precision and Guarantees
- System resources
- Reinitialize connections, file handles, or other non-serializable resources
- Lesson 2138 — Restoring transient Fields on Deserialization
- System-wide failure
- Not just your app—other programs may fail to open files
- Lesson 1942 — Why Closing Streams Matters: Resource Leaks Explained
T
- T3
- Thread A tries to acquire `lock2` → **BLOCKS** (B holds it)
- Lesson 2693 — Visualizing the Circular Wait
- T4
- Thread B tries to acquire `lock1` → **BLOCKS** (A holds it)
- Lesson 2693 — Visualizing the Circular Wait
- Tail-recursive version
- (factorial with accumulator):
- Lesson 231 — Tail Recursion: Optimizable Recursive Calls
- target
- determines the type.
- Lesson 1727 — What Is Target Typing?Lesson 2328 — Checking Type Relationships with isAssignableFrom
- target functional interface
- (the interface your lambda is being assigned to or passed as) and extracts the generic types from its declaration.
- Lesson 1714 — Type Inference with GenericsLesson 1739 — Method Reference Type Inference
- Target object
- The instance whose field you want to modify (or `null` for static fields)
- Lesson 2353 — Field.set: Writing Field Values
- target type
- the functional interface it's implementing.
- Lesson 1628 — Functional Interfaces Enable LambdasLesson 1709 — Type Inference Basics in Lambda ParametersLesson 1712 — Target Type and Contextual InformationLesson 1729 — Target Type from Variable DeclarationsLesson 1752 — Constructor Overloading Resolution
- Task Scheduling
- When you have jobs that arrive over time and must be executed in the order they arrived, a queue is your solution.
- Lesson 1174 — Queue Use Cases: Task Scheduling and BufferingLesson 1183 — What Is a PriorityQueue?
- Task Submission with Futures
- Lesson 2711 — ExecutorService: Extended Lifecycle and Task Management
- Team boundaries
- Allow specific modules maintained by your team to collaborate while hiding implementation details from external modules.
- Lesson 2484 — Multiple Qualified exports for Fine-Grained Control
- Team Conventions
- In large codebases, consistency matters.
- Lesson 1717 — Type Inference Benefits and Readability
- Team expertise is limited
- and training time isn't available
- Lesson 2524 — Migration Strategy: When to Use Module Path vs Classpath
- Technical requirements
- Lesson 2472 — Module Names and Naming Conventions
- Template Method
- pattern: `LinkedHashMap` defines the insertion algorithm, but lets you customize one specific decision point (whether to remove old entries) by overriding a hook method.
- Lesson 1148 — The removeEldestEntry Hook Method
- Template Method Pattern
- uses an abstract class to define the overall structure of an algorithm, while letting subclasses override specific steps.
- Lesson 529 — The Template Method Pattern with Abstract ClassesLesson 713 — Protected Access in Inheritance: The Protected Modifier
- Template methods
- When your method calls other overridable methods in a specific sequence that shouldn't be altered
- Lesson 424 — The final Keyword on Methods
- Terminal operation
- Produces a final result and triggers execution
- Lesson 1369 — The Stream Pipeline: Source, Intermediate, TerminalLesson 1395 — Terminal Operations Trigger Pipeline ExecutionLesson 1400 — Why No Result Without a Terminal OperationLesson 1599 — When to Use reducing vs Stream.reduceLesson 1817 — When or Completes the Chain: Terminal Operations
- Terminal operations
- produce a result or side effect
- Lesson 1393 — Understanding the Two Categories of Stream OperationsLesson 1401 — Identifying Operation Types in Real CodeLesson 1523 — Understanding Terminal Operations: count, min, and max
- TERMINATED
- – The thread has completed execution.
- Lesson 2580 — Thread States Overview: The Five-State ModelLesson 2610 — The join Method: Basic Syntax and Purpose
- Test
- the type with `instanceof`
- Lesson 452 — The Boilerplate Problem: Test-Cast-Use PatternLesson 453 — Pattern Matching for instanceof: Basic Syntax
- Test 3: Flush Frequency
- Lesson 1958 — Profiling I/O Performance: Identifying Bottlenecks
- Test boundaries
- Verify conversions preserve values correctly, especially around DST transitions
- Lesson 1902 — Interoperating with Legacy APIs
- Test incrementally
- Each automatic → explicit conversion should be validated independently
- Lesson 2543 — Migration Strategy: From Automatic to Explicit Modules
- Test thoroughly
- to confirm the module works both independently and when consumed
- Lesson 2526 — The Bottom-Up Migration Strategy
- Test Time Zone Conversions
- Lesson 1903 — Migration Checklist and Common Pitfalls
- Test with HashSet operations
- The simplest approach is to actually use your objects in a `HashSet` and verify the expected behavior:
- Lesson 1093 — Testing Your equals and hashCode Implementations
- Test your method calls
- to ensure they compile without ambiguity
- Lesson 215 — Common Overloading Pitfalls and Ambiguity
- Testable
- Easy to verify with different inputs
- Lesson 387 — Pure Functions and Statelessness in Utility Classes
- Testing
- JUnit's `@Test` tells the test runner which methods to execute
- Lesson 2438 — RetentionPolicy.RUNTIME ExplainedLesson 2803 — Using thenApplyAsync with Custom ExecutorLesson 2864 — Passing Custom Executors to Async Methods
- Testing vs Production
- Consider opening packages only to testing frameworks using qualified `opens`, keeping production code more locked down.
- Lesson 2497 — Security and Design Trade-offs with opens
- Tests become critical
- Runtime is the only place these breaks surface
- Lesson 2396 — Maintaining Code with Reflection
- Text alignment
- Preparing multi-line strings for display in columns
- Lesson 2221 — The indent Method: Adding Leading Whitespace
- Text blocks
- are a special syntax for multi-line string literals, introduced in Java 15.
- Lesson 2234 — What Are Text Blocks?Lesson 2243 — Text Blocks vs String Concatenation
- Text data
- consists of bytes that represent human-readable characters encoded using a character set (like UTF-8 or ASCII).
- Lesson 1930 — Binary Data vs Text DataLesson 1967 — Reader vs InputStream: When to Use Which
- Text transformation
- Prefix each line with line numbers or bullets
- Lesson 2224 — Combining lines with Stream Operations
- Text-oriented
- Designed specifically for reading textual data
- Lesson 1959 — The Reader Hierarchy: Character-Based Input
- Then
- add your element to the freshly expanded array
- Lesson 1013 — Triggering a Resize: When Capacity Is Exhausted
- They export everything
- All packages become public API, even internal implementation details
- Lesson 2543 — Migration Strategy: From Automatic to Explicit Modules
- They never throw ConcurrentModificationException
- , even if the map changes during iteration
- Lesson 1164 — Iterators and Weakly Consistent Views
- They reflect a snapshot
- of the map at (or near) the time the iterator was created
- Lesson 1164 — Iterators and Weakly Consistent Views
- They require everything
- They implicitly depend on all other modules, creating overly broad dependency graphs
- Lesson 2543 — Migration Strategy: From Automatic to Explicit Modules
- Think of it like
- A stack of plates—you must remove the top plate before accessing ones underneath.
- Lesson 1218 — Stack vs Queue Trade-offs in Problem SolvingLesson 1471 — What Are takeWhile and dropWhile?Lesson 2451 — Multiple Targets and TYPE_USE
- Third-party libraries aren't modular
- and heavily use reflection without proper `opens` declarations
- Lesson 2524 — Migration Strategy: When to Use Module Path vs Classpath
- this
- specific box design.
- Lesson 1521 — Specifying the Map Implementation with toMapLesson 2328 — Checking Type Relationships with isAssignableFrom
- This class is incomplete
- – it represents a general concept that shouldn't exist on its own
- Lesson 478 — The abstract Keyword for Classes
- This is completely false
- Lesson 665 — Package Hierarchies Are Not Inheritance
- thread
- is a lightweight path of execution within a process.
- Lesson 2554 — Thread: A Lightweight Execution UnitLesson 2556 — Creation Overhead: Heavy vs Lightweight
- Thread A
- acquires a monitor lock on an object by entering a `synchronized` block
- Lesson 2584 — BLOCKED State: Waiting for Monitor LockLesson 2646 — Lost Updates: The Classic ProblemLesson 2693 — Visualizing the Circular Wait
- Thread B
- tries to enter a `synchronized` block on the *same object*
- Lesson 2584 — BLOCKED State: Waiting for Monitor LockLesson 2646 — Lost Updates: The Classic ProblemLesson 2693 — Visualizing the Circular Wait
- Thread configuration
- Control thread counts, priorities, or naming
- Lesson 2864 — Passing Custom Executors to Async Methods
- Thread contention
- causes threads to block and wait unnecessarily
- Lesson 1032 — Vector's Synchronization MechanismLesson 1251 — Performance Implications of Synchronized Wrappers
- Thread pool compatibility
- `Runnable` works seamlessly with executor frameworks you'll learn later
- Lesson 2572 — Creating a Thread with Runnable
- Thread pool environments
- Risk of data leakage between requests
- Lesson 2641 — ThreadLocal Alternatives and When to Avoid It
- Thread priority imbalance
- High-priority threads monopolize CPU time (you learned about priority risks in lesson 2631)
- Lesson 2705 — What Is Starvation?
- Thread reuse
- Avoids the overhead of creating and destroying threads
- Lesson 2720 — newFixedThreadPool: Creating a Fixed-Size Thread Pool
- thread safety
- Lesson 1031 — Vector vs ArrayList: Key DifferencesLesson 1153 — Hashtable vs HashMap: Key DifferencesLesson 1555 — Specifying Map Implementation with toMap()Lesson 2194 — When to Use StringBuilder vs StringBuffer
- Thread safety without synchronization
- immutable objects are inherently safe to share
- Lesson 727 — Immutability and final: Defensive Access Control
- Thread starvation
- happens when a thread never gets CPU time because other threads with equal or higher priority constantly monopolize the processor.
- Lesson 2631 — Priority Inversion and Starvation Risks
- Thread Stop Flags
- Lesson 2686 — Common Use Cases: Status Flags and Control Variables
- Thread-confined objects
- avoiding synchronization overhead by giving each thread its own instance
- Lesson 2633 — What is ThreadLocal and Why It Exists
- Thread-safe
- Multiple parts of your program can use them simultaneously without conflicts
- Lesson 387 — Pure Functions and Statelessness in Utility ClassesLesson 727 — Immutability and final: Defensive Access ControlLesson 1380 — Stateful vs Stateless Stream GenerationLesson 1835 — Instant Immutability and Thread Safety
- Threads
- , however, are like roommates sharing the same house.
- Lesson 2555 — Memory Isolation: Processes vs ThreadsLesson 2558 — Crash Isolation: Process Safety
- Threads terminate
- only after all work is done do the pool threads exit
- Lesson 2715 — Graceful Shutdown: The shutdown Method
- threshold
- is the exact number of elements that, when reached, forces HashSet to rehash.
- Lesson 1060 — Threshold: When Rehashing TriggersLesson 1125 — When Rehashing Occurs: The Threshold Calculation
- Throws `FileAlreadyExistsException`
- if the target already exists (it won't overwrite by default)
- Lesson 2055 — Files.copy: Basic File Copying
- Throws `IOException`
- for other I/O problems (permissions, disk space, etc.
- Lesson 2055 — Files.copy: Basic File Copying
- Throws `NoSuchFileException`
- if the source file doesn't exist
- Lesson 2055 — Files.copy: Basic File Copying
- Throws if all fail
- If every task throws an exception, `invokeAny` throws `ExecutionException` wrapping the last exception encountered.
- Lesson 2763 — invokeAny: Racing Multiple Callables
- Tight coupling
- where the inner class is meaningless without its outer context
- Lesson 630 — Inner Classes and Encapsulation
- Tight loops
- If you're calling a reflected method millions of times per second in performance-critical code (data processing, game loops, real-time systems), the overhead becomes noticeable.
- Lesson 2350 — Performance Costs of Reflective Invocation
- Tighter coupling
- Abstract classes suggest implementation sharing, not just type tagging.
- Lesson 530 — Marker Interfaces vs Empty Abstract Classes
- Time Complexity
- O(n/2), which simplifies to **O(n)**—you visit roughly half the elements, but each swap touches two positions
- Lesson 1230 — Reverse Internals: How Swapping Works
- Time without context
- Use `LocalDateTime` for internal calculations where time zones don't matter.
- Lesson 1856 — Best Practices: When to Use ZonedDateTime
- Time Zone Nightmares
- `Date` didn't truly represent a "date"—it was just milliseconds since the Unix epoch (January 1, 1970 UTC).
- Lesson 1895 — Problems with java.util.Date and java.util.Calendar
- TIMED_WAITING
- instead, which we haven't covered yet.
- Lesson 2585 — WAITING State: Indefinite WaitLesson 2586 — TIMED_WAITING State: Waiting with Timeout
- Timeout issues
- The database took too long to respond
- Lesson 806 — SQLException: Database Access Errors
- Timeout variant
- `invokeAll(tasks, timeout, unit)` cancels incomplete tasks after the timeout
- Lesson 2758 — invokeAll: Executing Multiple Callables
- Timeouts
- Use operations with built-in timeout mechanisms when available, so blocking doesn't last forever
- Lesson 2607 — Interruption and Non-Interruptible Blocking
- Timestamps
- When the error occurred at this layer
- Lesson 773 — Logging and Rethrowing: Best PracticesLesson 2138 — Restoring transient Fields on Deserialization
- TimSort
- , a hybrid sorting algorithm that combines merge sort and insertion sort.
- Lesson 1221 — Sorting Stability and Implementation DetailsLesson 1227 — Performance Characteristics of SortingLesson 1364 — Sorting Performance Considerations
- Together
- , they guarantee the object's state never changes
- Lesson 727 — Immutability and final: Defensive Access Control
- Too high (e.g., 0.9)
- Lesson 1058 — Default Load Factor: 0.75
- Too large
- (like 2x): You waste significant memory with unused capacity
- Lesson 1007 — The Growth Strategy: 1.5x Expansion
- Too low (e.g., 0.5)
- Lesson 1058 — Default Load Factor: 0.75
- Top-level class
- Pollutes namespace for single-use logic
- Lesson 639 — Practical Use Cases for Local Classes
- Track state across iterations
- Maintain counters or accumulators that survive beyond one loop cycle
- Lesson 191 — Declaring Variables Before Control Structures
- Trade-off
- Elements have no guaranteed order.
- Lesson 981 — HashSet vs TreeSet: Performance vs Ordering Trade-offsLesson 1009 — trimToSize: Reclaiming Unused Capacity
- Traditional DI frameworks
- are runtime-heavy solutions that scan classes, read annotations, manage object lifecycles, and inject dependencies automatically.
- Lesson 2507 — Service Loading vs Traditional Dependency Injection
- Traditional way (anonymous class)
- Lesson 2564 — Lambda Expressions with Runnable
- Trailing delimiters (special behavior)
- Lesson 2209 — Handling Empty Strings and Edge Cases in split()
- Transaction Management
- Lesson 2624 — Daemon Thread Limitations and Risks
- Transform before comparing
- Sort strings case-insensitively, trim whitespace, or apply calculations
- Lesson 1339 — Comparator.comparing() with Lambda Expressions
- transforms
- your clean for-each syntax into traditional iterator code before generating bytecode.
- Lesson 1292 — How the Enhanced For Loop Works InternallyLesson 1436 — What flatMap Does: Flattening Nested Structures
- Transient fields
- (marked with `transient` keyword) → skipped
- Lesson 2106 — Automatic Serialization of Instance Fields
- Transitive
- Lesson 289 — Overriding equals: The Contract and RulesLesson 542 — Overriding equals: The Five RequirementsLesson 2478 — Combining requires Modifiers
- TreeMap
- maintains keys in sorted order using a red-black tree, with O(log n) operations.
- Lesson 982 — HashMap vs TreeMap: When Sorted Keys Are Worth the CostLesson 999 — TreeMap: Sorted Map with Ordered KeysLesson 1577 — Custom Map Types with groupingBy Supplier
- TreeMap (sorted keys)
- Lesson 1521 — Specifying the Map Implementation with toMap
- TreeSet
- When you need sorted elements or range-based queries
- Lesson 981 — HashSet vs TreeSet: Performance vs Ordering Trade-offsLesson 1075 — Performance Trade- offs: TreeSet vs HashSetLesson 1080 — Iterating LinkedHashSetLesson 1518 — Collectors.toCollection() for Specific Collection TypesLesson 1574 — Collecting to Different Collection Types per Group
- True Immutability
- Java 9+ factories create truly immutable collections, not just unmodifiable views
- Lesson 1263 — Comparing Factory Methods with Java 9+ Collection Factories
- TRUNCATE_EXISTING
- If the file exists, truncate it to zero length (erasing all previous content) before writing.
- Lesson 2051 — OpenOption: Controlling Write Behavior
- truncates
- it by discarding the high-order bits that don't fit.
- Lesson 80 — Truncation in Integer Narrowing CastsLesson 87 — Integer Division and TruncationLesson 1917 — Understanding FileOutputStream: Writing Bytes to Files
- try-with-resources
- for automatic resource management
- Lesson 574 — The finalize Method: Legacy Cleanup MechanismLesson 829 — Why AutoCloseable MattersLesson 830 — Basic Try-With-Resources SyntaxLesson 1945 — Try-With-Resources: Automatic Resource ManagementLesson 2041 — Streaming Lines: Files.lines for Memory-Efficient Reading
- Try-with-resources (modern way)
- Lesson 853 — Reduced Boilerplate and Readability
- two
- access modifier options: `public` or **default** (package-private, meaning no modifier at all).
- Lesson 694 — Class-Level Access Modifiers OverviewLesson 707 — Protected Access Without InheritanceLesson 2001 — UTF-16 and UTF-32Lesson 2679 — Practical Example: Reentrant Lock in Action
- two parameters
- , your lambda must declare both:
- Lesson 1675 — BiFunction apply Method and Lambda SyntaxLesson 2845 — handle vs exceptionally: Key Differences
- Two separate methods
- (one for sorting, one for saving)
- Lesson 925 — Use Case: Combining Comparable and Serializable
- two-dimensional array
- , which you can visualize as a grid or table with rows and columns.
- Lesson 253 — What Are Multidimensional Arrays?Lesson 2383 — Reading Annotations from Constructors and Parameters
- type argument
- .
- Lesson 858 — Instantiating Generic Classes with Type ArgumentsLesson 901 — Creating ArrayList with Type Arguments
- Type casting
- You must cast each object back to its original type
- Lesson 2115 — Serializing Multiple Objects in Sequence
- Type checking and validation
- happen at runtime instead of compile-time
- Lesson 2395 — Performance Overhead of Reflection
- Type checking at runtime
- Determine if two objects are instances of the exact same class
- Lesson 571 — The getClass Method: Runtime Type InformationLesson 2350 — Performance Costs of Reflective Invocation
- type compatibility
- or **substitutability**.
- Lesson 401 — Type Compatibility: Subclass Instances as Superclass ReferencesLesson 435 — Substitutability: Liskov Substitution Principle
- type erasure
- Java's implementation of generics.
- Lesson 877 — Generic Array Creation RestrictionsLesson 891 — What Is Type Erasure?Lesson 897 — Cannot Create Generic ArraysLesson 962 — Cannot Use instanceof with Parameterized TypesLesson 966 — Reified Generics in Other Languages: What Java LacksLesson 1001 — The Object Array Backing Store
- type inference
- it examines the types of the arguments you pass and deduces what the type parameters should be.
- Lesson 867 — Type Inference in Generic Method CallsLesson 905 — The Diamond Operator: Type InferenceLesson 1656 — Type Safety and Generic Type Inference in FunctionsLesson 1700 — Single Parameter Lambda: Parentheses OptionalLesson 1716 — Parentheses Rules for Single ParametersLesson 1739 — Method Reference Type Inference
- Type of parameters
- (one takes `int`, another takes `double`)
- Lesson 207 — Method Overloading Fundamentals
- Type pattern matching
- extends `switch` to test *what type* an object is, similar to how you'd use multiple `instanceof` checks.
- Lesson 154 — Pattern Matching in switch (Preview/Java 17+)
- type safety
- the compiler guarantees you're only calling methods that should exist, while dynamic dispatch ensures the *correct version* runs based on the actual object.
- Lesson 465 — The Role of the Reference Type at Compile TimeLesson 475 — Practical Benefits: Avoiding DowncastsLesson 490 — Implementing Interface Methods: Overriding RulesLesson 578 — What Are Enums and Why They MatterLesson 855 — What Are Generics and Why They MatterLesson 912 — Bounded Type Parameters with ClassesLesson 967 — The Collections Framework: Purpose and DesignLesson 1899 — Replacing Calendar Arithmetic with Period and Duration (+1 more)
- Type Safety Preserved
- The compiler still enforces all type checks using the target type context.
- Lesson 1717 — Type Inference Benefits and Readability
- Type Specialization
- The JIT thrives on knowing exact types to generate optimized machine code.
- Lesson 2402 — JIT Compilation Limits with Reflection
- Type-safe
- (only accepts enum constants from a single enum type)
- Lesson 597 — Introduction to EnumSet: A Specialized Set for EnumsLesson 605 — Practical Use Cases: State Machines and ConfigurationLesson 2322 — Using .class Literal SyntaxLesson 2800 — Chaining Multiple thenApply Calls
- Type-safe merging
- You can combine different result types (Integer + String → String)
- Lesson 2825 — Understanding thenCombine: Combining Independent Futures
- Type-safe return
- The compiler knows the return type matches `T`
- Lesson 898 — Type Tokens and Reification Workarounds
- types
- .
- Lesson 209 — Overloading by Parameter TypeLesson 2443 — ElementType.TYPE: Annotating Classes and Interfaces
- Typo prevention
- Catches misspellings like `tostring()` instead of `toString()`
- Lesson 2414 — Built-In Annotations: When and Why to Use Each
- Typos in method names
- (`tostring()` instead of `toString()`)
- Lesson 423 — Best Practices: Always Use @Override
U
- unary operator
- that inverts a boolean value.
- Lesson 109 — Logical NOT Operator: !Lesson 118 — The Bitwise NOT Operator (~)
- Unary Operators
- (one input, one output of the same type):
- Lesson 1688 — Primitive Specializations: IntUnaryOperator, LongBinaryOperator, etc.
- UnaryOperator
- A function that takes the previous value and produces the next one
- Lesson 1378 — Stream.iterate() with Seed and UnaryOperatorLesson 1629 — Common Functional Interfaces in java.util.function
- Unbounded
- `LinkedList`, `PriorityQueue`—grow until memory runs out
- Lesson 1172 — Queue Capacity Restrictions and Bounded Queues
- unbounded wildcard
- like `List<?
- Lesson 887 — Raw Types vs Unbounded WildcardsLesson 953 — Unbounded Wildcards vs Raw TypesLesson 962 — Cannot Use instanceof with Parameterized Types
- unboxing
- , happens when retrieving values:
- Lesson 904 — Autoboxing with Generic CollectionsLesson 1690 — Why Primitive Specializations Exist
- Unbuffered I/O
- is like making a separate trip to the store for each individual item—milk on Monday, bread on Tuesday, eggs on Wednesday.
- Lesson 1932 — The Problem with Unbuffered I/O: System Call Overhead
- Uncaught exception handlers
- specific to your pool's tasks
- Lesson 2728 — Thread Naming and Daemon Status in Factory Methods
- Unchecked
- All subclasses of `RuntimeException`, plus all subclasses of `Error`
- Lesson 783 — The Two Categories: Checked and Unchecked ExceptionsLesson 795 — ArrayIndexOutOfBoundsException and Bounds CheckingLesson 812 — Choosing Between Checked and Unchecked
- unchecked exception
- is any exception that extends `RuntimeException` (or is `RuntimeException` itself).
- Lesson 785 — What Makes an Exception Unchecked?Lesson 796 — IndexOutOfBoundsException in CollectionsLesson 812 — Choosing Between Checked and UncheckedLesson 826 — Exceptions in close()
- Unchecked exceptions
- (like `RuntimeException`) don't require declaration (though you can declare them)
- Lesson 743 — Method Signatures and throws DeclarationLesson 783 — The Two Categories: Checked and Unchecked ExceptionsLesson 792 — Overriding Methods and Exception CompatibilityLesson 812 — Choosing Between Checked and UncheckedLesson 2783 — The get and join Methods: Blocking for Results
- Underflow
- happens when a negative value is too small (too negative).
- Lesson 85 — Casting Pitfalls: Overflow, Underflow, and Best Practices
- Undo/Redo Functionality
- Lesson 1201 — When to Use Deque: Use Cases for Double-Ended Access
- Unfair lock acquisition
- Some threads repeatedly grab a lock before a waiting thread gets its turn
- Lesson 2705 — What Is Starvation?
- Unicode values
- Behind the scenes, each character is stored as a number from 0 to 65,535.
- Lesson 48 — The char Type: Representing Single Characters
- Union
- is straightforward—simply list multiple ranges or characters inside one set of brackets, and any character matching *any* of those ranges will match.
- Lesson 2299 — Union and Intersection in Character Classes
- Unique keys
- Each key appears only once; duplicate keys replace the old value
- Lesson 997 — HashMap: Key-Value Pairs with Hashing
- uniqueness
- .
- Lesson 970 — Set Interface: Unordered Collections Without DuplicatesLesson 1066 — What is TreeSet? Sorted Set Fundamentals
- Unit of operation
- `Reader` works with `char` instead of `byte`
- Lesson 1959 — The Reader Hierarchy: Character-Based Input
- Unit testing
- ThreadLocal makes mocking and isolation difficult
- Lesson 2641 — ThreadLocal Alternatives and When to Avoid It
- Universal familiarity
- Nearly every Java developer uses `ArrayList` regularly
- Lesson 900 — ArrayList<E> as the Canonical Generic Collection
- Unix/Linux
- `\n` (line feed only)
- Lesson 1984 — newLine: Platform-Independent Line SeparatorsLesson 2069 — Files.isSymbolicLink() and Files.isHidden()
- Unmappable characters
- You're writing a character that doesn't exist in your chosen encoding (e.
- Lesson 2006 — Encoding Errors and Replacement Characters
- Unmodifiable
- A view that prevents *you* from making changes, but the underlying collection can still change
- Lesson 1238 — What Are Unmodifiable Collections?
- Unmodifiable collections
- Collections wrapped to be read-only (you'll learn wrapper methods later)
- Lesson 802 — UnsupportedOperationException in CollectionsLesson 1281 — Why remove() Is Optional and May Throw UnsupportedOperationException
- Unmodifiable views
- wrap the original collection and block modification methods.
- Lesson 1245 — Defensive Copying vs Unmodifiable Views
- unnamed module
- .
- Lesson 2469 — Unnamed Modules and CompatibilityLesson 2519 — Mixing Module Path and Classpath: Compatibility ModeLesson 2520 — Class Loading Differences: Modules vs ClasspathLesson 2541 — Reading the Unnamed Module from Automatic Modules
- Unpredictable behavior
- Class loading order determined which version you got
- Lesson 2487 — Package Splitting and exports: Avoiding ConflictsLesson 2522 — Split Packages: The Problem JPMS Solves
- Unpredictable timing
- You can't control when (or if) GC runs
- Lesson 300 — The finalize Method (Deprecated)Lesson 574 — The finalize Method: Legacy Cleanup MechanismLesson 577 — Deprecation of finalize in Java 9+
- UnsatisfiedLinkError
- Native method dependency cannot be found.
- Lesson 782 — VirtualMachineError and LinkageError: System-Level Errors
- Unstable
- uses Dual-Pivot Quicksort for performance.
- Lesson 1363 — Stable vs Unstable SortingLesson 1364 — Sorting Performance Considerations
- Unstable naming
- Without an `Automatic-Module-Name` manifest entry, module names derive from filenames, which can change
- Lesson 2543 — Migration Strategy: From Automatic to Explicit Modules
- Unwind the stack
- – The JVM searches backward through method calls looking for a matching `catch` block, executing any `finally` blocks along the way
- Lesson 755 — Performance Impact of Unwinding
- Upcasting
- is when you treat a subclass instance as if it were an instance of its superclass.
- Lesson 439 — What is Upcasting?
- Update
- – Executes after the body completes
- Lesson 166 — Executing for Loops: Step-by-Step Evaluation OrderLesson 251 — Iterating Arrays in Reverse Order
- Update a single index
- (the `head` or `tail` pointer)
- Lesson 1208 — Performance Characteristics: O(1) Operations
- Update Serialization Logic
- Lesson 1903 — Migration Checklist and Common Pitfalls
- Update the head reference
- to point to the new node instead of the old first node
- Lesson 1022 — Adding Elements to the BeginningLesson 1025 — Removing the First Element
- Updating data structures
- Lesson 1677 — BiConsumer<T, U>: Two Inputs, No Return
- Updating external state
- Lesson 1492 — Side Effects in forEach
- upper bound
- a constraint that limits which types are allowed.
- Lesson 911 — The extends Keyword in Generic Type ParametersLesson 916 — Why extends Works for Both Classes and Interfaces
- URL Component Extraction
- Lesson 2272 — Practical Use Cases: Parsing Structured Text
- Use `execute()` when
- Lesson 2732 — execute vs submit: Return Type Differences
- Use `exports`
- for your public API—classes you want other modules to depend on and use directly
- Lesson 2491 — opens vs exports: Key Differences
- Use `flatMap`
- when each input element transforms into **zero, one, or multiple output elements** that need to be "unpacked" into a single flat stream:
- Lesson 1439 — flatMap vs map: When to Use Each
- Use `forEach()` when
- Lesson 1458 — peek vs forEach: Key Differences
- Use `forEach` when
- Lesson 1299 — forEach Method vs Enhanced For Loop
- Use `HashMap`
- for single-threaded code or when you can control synchronization externally
- Lesson 1153 — Hashtable vs HashMap: Key Differences
- Use `ifPresent`
- when you want to perform a side effect (logging, updating external state) with the value as-is
- Lesson 1799 — Common Mistakes: Using ifPresent When map Is Better
- Use `indexOf()`
- to locate the `@` symbol
- Lesson 2205 — Combining substring, indexOf, and replace for String Parsing
- Use `map`
- when each input element transforms into **exactly one output element**.
- Lesson 1439 — flatMap vs map: When to Use EachLesson 1799 — Common Mistakes: Using ifPresent When map Is Better
- Use `opens`
- for frameworks that need reflection (like Spring, Hibernate, or JUnit) but aren't part of your intended API
- Lesson 2491 — opens vs exports: Key Differences
- Use `Optional.of(value)`
- when you **guarantee** the value is **never null**.
- Lesson 1766 — When to Use of() vs ofNullable()
- Use `Optional.ofNullable(value)`
- when the value **might be null**, and you want to handle that possibility gracefully.
- Lesson 1766 — When to Use of() vs ofNullable()
- Use `orElse` for
- Simple constants or pre-computed values
- Lesson 1824 — Anti-Pattern: Overusing orElse with Expensive Operations
- Use `orElseGet` for
- Method calls, object creation, or any computation
- Lesson 1824 — Anti-Pattern: Overusing orElse with Expensive Operations
- Use `peek()` when
- Lesson 1458 — peek vs forEach: Key Differences
- Use `replace()`
- to sanitize or normalize the parts
- Lesson 2205 — Combining substring, indexOf, and replace for String Parsing
- Use `ServiceLoader`
- to discover and load implementations dynamically — no direct constructor calls
- Lesson 2498 — The Service Provider Interface (SPI) Pattern
- Use `shutdown()`
- when task completion matters (database updates, file processing, network requests)
- Lesson 2768 — Understanding Graceful vs Immediate Shutdown
- Use `shutdownNow()`
- when speed matters more than completion (emergency shutdown, application crash recovery)
- Lesson 2768 — Understanding Graceful vs Immediate Shutdown
- Use `StringBuffer` only when
- Multiple threads will access and modify the *same* instance concurrently.
- Lesson 2194 — When to Use StringBuilder vs StringBuffer
- Use `submit()` when
- Lesson 2732 — execute vs submit: Return Type Differences
- Use `substring()`
- to extract the username and domain separately
- Lesson 2205 — Combining substring, indexOf, and replace for String Parsing
- Use `teeing` when
- Lesson 1614 — When to Use teeing vs Separate Collectors
- Use `thenAccept`
- when you need to *consume* the result of the previous stage
- Lesson 2813 — Choosing Between thenAccept and thenRun
- Use `thenApply` when
- Lesson 2801 — thenApply vs thenApplyAsync
- Use `thenApplyAsync` when
- Lesson 2801 — thenApply vs thenApplyAsync
- Use `thenRun`
- when you just need to run an action *after completion*, regardless of the result
- Lesson 2813 — Choosing Between thenAccept and thenRun
- Use `this`
- when simplicity matters and you control all synchronization
- Lesson 2663 — Choosing the Lock Object
- Use a dedicated lock
- when you need isolation, multiple locks for different purposes, or when building libraries
- Lesson 2663 — Choosing the Lock Object
- Use async variants when
- Lesson 2812 — Async Variants: thenAcceptAsync and thenRunAsync
- Use case
- Caches where entries can be discarded when memory is tight.
- Lesson 302 — Weak, Soft, and Phantom References
- Use cases include
- Lesson 2633 — What is ThreadLocal and Why It Exists
- Use Collections.synchronizedMap when
- Lesson 1156 — Thread Safety: Hashtable vs Collections.synchronizedMap
- Use Custom Comparators When
- Lesson 1346 — When to Use Factory Methods vs Custom Comparators
- Use descriptive names
- that reflect the relationship: `Builder`, `Config`, `Validator`
- Lesson 621 — Common Use Cases and Best Practices
- Use Factory Methods When
- Lesson 1346 — When to Use Factory Methods vs Custom Comparators
- Use generics when
- Lesson 1698 — When to Use Primitive Specializations vs Generics
- Use Hashtable when
- Lesson 1156 — Thread Safety: Hashtable vs Collections.synchronizedMap
- Use lazy operations
- Streams process lazily, so terminating early (with `findFirst()` or `limit()`) stops traversal
- Lesson 2093 — Performance and Resource Management in Walks
- Use length-based loops
- Lesson 795 — ArrayIndexOutOfBoundsException and Bounds Checking
- Use List when
- Lesson 1170 — Queue vs List: When to Use Each
- Use meaningful defaults
- Lesson 794 — NullPointerException: The Most Common Runtime Error
- Use nouns
- classes represent things (`Car`, `Student`, `Invoice`)
- Lesson 305 — Declaring a Class: Syntax and Naming Conventions
- Use OffsetDateTime when
- Lesson 1870 — OffsetDateTime vs ZonedDateTime
- Use parentheses
- when you're unsure or want to make your intent crystal clear:
- Lesson 112 — Chaining Comparisons and Operator Precedence
- Use PascalCase
- capitalize the first letter of each word (`BankAccount`, `User`, `ShoppingCart`)
- Lesson 305 — Declaring a Class: Syntax and Naming Conventions
- Use primitive specializations when
- Lesson 1698 — When to Use Primitive Specializations vs Generics
- Use Queue when
- Lesson 1170 — Queue vs List: When to Use Each
- Use separate classes when
- Lesson 596 — Enums vs Classes: When to Use Fields and Methods
- Use specific module names
- rather than `ALL-UNNAMED` when possible
- Lesson 2530 — Using --add-exports and --add-opens as Temporary Workarounds
- Use static imports sparingly
- , primarily for widely-recognized constants (`PI`, `E`) or frequently-used utility methods (`max`, `min`)
- Lesson 675 — Static Import Anti-Patterns and Best Practices
- Use static imports when
- Lesson 381 — Best Practices for static Imports
- Use synchronized blocks when
- Lesson 2661 — Synchronized Blocks vs Synchronized Methods
- Use synchronized methods when
- Lesson 2661 — Synchronized Blocks vs Synchronized Methods
- Use values after branching
- Access data determined by an `if-else` after the entire conditional completes
- Lesson 191 — Declaring Variables Before Control Structures
- Use varargs when
- Lesson 222 — Varargs vs Array Parameters
- Use very rarely
- you're essentially putting tape over your check-engine light.
- Lesson 2412 — @SuppressWarnings: Common Warning Types
- Use when
- Order matters and duplicates are allowed.
- Lesson 979 — List vs Set vs Map: The Fundamental Decision
- Use wrapper methods
- Encapsulate conversions in dedicated utility methods
- Lesson 1902 — Interoperating with Legacy APIs
- Use ZonedDateTime when
- Lesson 1856 — Best Practices: When to Use ZonedDateTimeLesson 1870 — OffsetDateTime vs ZonedDateTime
- User threads
- are the paying customers.
- Lesson 2619 — User Threads vs Daemon ThreadsLesson 2621 — JVM Termination and Daemon Threads
- User-facing applications
- Where responsiveness matters more than completion
- Lesson 2742 — get() with Timeout: Avoiding Indefinite Blocking
- User-facing timestamps matter
- When displaying times to users in different locations.
- Lesson 1856 — Best Practices: When to Use ZonedDateTime
- Username requirements
- Confirming input meets length and character rules
- Lesson 2256 — Using matches() for Full String Validation
- Usernames
- Specific character sets and length rules
- Lesson 2260 — When to Use matches(): Input Validation and Format Checking
- Uses common terminology
- Stick to terms your team and industry understand, avoiding abbreviations that aren't obvious
- Lesson 683 — Best Practices: Meaningful Package Names
- Using `.class` literal
- `Class<String> c = String.
- Lesson 382 — The Class Object: Representing Types at Runtime
- Using a method reference
- Lesson 1660 — Consumer in forEach: Iterating Collections
- Using method references
- Lesson 1456 — Basic peek Syntax and Usage
- Using the -classpath option
- Lesson 2129 — Using serialver Tool to Generate IDs
- Using try-catch
- Lesson 809 — ParseException: Data Parsing Failures
- UTF-16
- Uses 2 or 4 bytes per character (Java's internal char representation)
- Lesson 1997 — What Is Character Encoding?Lesson 2001 — UTF-16 and UTF-32
- UTF-8
- Variable-length encoding supporting all Unicode characters (1-4 bytes per character)—the modern standard
- Lesson 1997 — What Is Character Encoding?Lesson 2047 — Character Encoding with Charset Parameters
- utility class
- that provides static methods specifically designed to make array manipulation easier.
- Lesson 263 — The Arrays Class and Its PurposeLesson 385 — What Is a Utility Class?
- Utility classes
- that only contain static methods (like `Math` or `Collections`)
- Lesson 870 — Generic Static Methods: Utility Method Patterns
V
- Valid - All explicit
- Lesson 1707 — Mixing Explicit and Implicit Types: Not Allowed
- Valid - All implicit
- Lesson 1707 — Mixing Explicit and Implicit Types: Not Allowed
- Valid combinations
- Lesson 430 — Combining final with Other Modifiers
- Validate method parameters
- Lesson 794 — NullPointerException: The Most Common Runtime Error
- Validate the range
- before casting
- Lesson 85 — Casting Pitfalls: Overflow, Underflow, and Best Practices
- validates
- that your lambda's behavior matches the inferred types.
- Lesson 1656 — Type Safety and Generic Type Inference in FunctionsLesson 2476 — The Readability Graph
- Validating relationships
- Lesson 1647 — BiPredicate for Two-Argument Conditions
- Validating user input
- Lesson 1853 — Getting Available Time Zone IDs
- Validation
- Ensure an element appears exactly once or no more than N times
- Lesson 1264 — Collections.frequency: Counting Element OccurrencesLesson 2438 — RetentionPolicy.RUNTIME ExplainedLesson 2470 — Module Graph and Dependencies at RuntimeLesson 2625 — Checking Daemon Status
- Validation (Bean Validation)
- Lesson 2439 — Use Cases for RUNTIME Retention
- Validation Frameworks
- Libraries scan for annotations like `@NotNull`, `@Min`, or `@Email` on fields, then reflectively read each field's value and apply the corresponding constraint.
- Lesson 2387 — Practical Use Cases: Frameworks and Custom Processing
- Validation with context
- Lesson 1679 — BiPredicate<T, U>: Two-Argument Boolean Tests
- value
- .
- Lesson 1049 — HashSet add: Calling HashMap putLesson 1106 — Bucket Contents: Linked List NodesLesson 2124 — Declaring an Explicit serialVersionUID
- Value -1
- A special sentinel indicating end-of-stream
- Lesson 1905 — The read() Method: Reading a Single Byte
- Value propagation
- For non-`void` methods, it sends a value back to whoever called the method
- Lesson 196 — The return Statement: Early Exit and Value Propagation
- Value Range Checks
- Lesson 1640 — Creating Simple Predicates with Lambda Expressions
- Value-returning methods
- perform an action *and* give you a result (like asking someone to "calculate the total and tell me the answer")
- Lesson 195 — Return Types: void vs Value-Returning Methods
- valueMapper
- A `Function` that takes the same element and returns its value
- Lesson 1519 — Collectors.toMap() with Key and Value MappersLesson 1552 — Collectors.toMap(): Basic Key-Value Mapping
- values
- Lesson 908 — HashSet<E> and HashMap<K,V>: Multiple Type ParametersLesson 973 — Map Interface: Key-Value Associations
- Values 0-255
- The actual byte value, returned as an unsigned integer
- Lesson 1905 — The read() Method: Reading a Single Byte
- Varargs
- (variable-length arguments)
- Lesson 214 — Overloading with Autoboxing and VarargsLesson 215 — Common Overloading Pitfalls and AmbiguityLesson 220 — Method Overloading with VarargsLesson 222 — Varargs vs Array ParametersLesson 1374 — Stream.of() for Fixed Elements
- Varargs parameter
- Accepts any number of `CompletableFuture` instances
- Lesson 2854 — CompletableFuture.allOf: Waiting for All TasksLesson 2855 — Using allOf with Varargs
- Variable level
- Suppresses warnings only for that variable's declaration
- Lesson 2413 — @SuppressWarnings: Scope and Best Practices
- Variable name
- A reference to the exception object, so you can access its details
- Lesson 730 — The catch Block: Handling Specific Exception Types
- Vector
- Every method is `synchronized`, meaning only one thread can access the method at a time.
- Lesson 1031 — Vector vs ArrayList: Key Differences
- Verbose
- Simple resource cleanup requires 7+ lines of boilerplate
- Lesson 850 — The Classic finally Block Pattern
- Verbose and repetitive
- The cast is redundant—you already proved the type with `instanceof`
- Lesson 452 — The Boilerplate Problem: Test-Cast-Use Pattern
- Verify
- The installer handles most setup automatically
- Lesson 4 — Installing the JDK on Your Operating System
- Verify internal state
- Check that a private counter incremented correctly
- Lesson 2390 — Testing: Accessing Private Members
- Version control
- Your app always runs on the exact Java version you tested
- Lesson 2551 — Distributing Custom Runtime Images
- Version Information
- Tracks implementation and specification versions:
- Lesson 686 — The JAR Manifest File
- Version management headaches
- Maintaining serialization compatibility across versions requires `serialVersionUID` management and careful planning.
- Lesson 2111 — When to Use and Avoid Serialization
- Versioning conflicts
- Two libraries shipping different versions of `org.
- Lesson 2487 — Package Splitting and exports: Avoiding Conflicts
- view
- of your `NavigableSet` in reverse order.
- Lesson 1098 — DescendingSet: Reverse Order ViewsLesson 1240 — Collections.unmodifiableSet and unmodifiableMapLesson 1242 — Collections.unmodifiableCollection for Generic Types
- views
- of portions of your map based on key boundaries.
- Lesson 1140 — NavigableMap Operations: headMap, tailMap, subMapLesson 1240 — Collections.unmodifiableSet and unmodifiableMap
- Visa
- , you need a pattern that matches a `4` followed by 12 or 15 more digits:
- Lesson 2288 — Credit Card Number Patterns
- Visibility
- You want the class to be easily discoverable in your package's public API
- Lesson 619 — Static Nested Classes vs Top-Level ClassesLesson 2686 — Common Use Cases: Status Flags and Control Variables
- void
- when your method's purpose is to cause a *side effect* (printing, modifying variables, etc.
- Lesson 195 — Return Types: void vs Value-Returning MethodsLesson 2322 — Using .class Literal Syntax
- Voting systems
- Count votes for each option
- Lesson 1264 — Collections.frequency: Counting Element Occurrences
W
- Wait for both
- The combined future completes only when both inputs complete
- Lesson 2825 — Understanding thenCombine: Combining Independent Futures
- WAITING
- – The thread is indefinitely waiting for another thread to perform a specific action (like notifying it).
- Lesson 2580 — Thread States Overview: The Five-State ModelLesson 2585 — WAITING State: Indefinite WaitLesson 2610 — The join Method: Basic Syntax and Purpose
- Warm-up runs
- to let the JVM optimize both approaches before measuring
- Lesson 2398 — Method Invocation Overhead: invoke vs Direct Calls
- Weak encapsulation
- Even with `private` and package-private access, internal implementation classes could be accessed if someone knew the fully-qualified name.
- Lesson 2461 — Introduction to JPMS and the Module System
- weakly consistent
- , meaning:
- Lesson 1164 — Iterators and Weakly Consistent ViewsLesson 1307 — ConcurrentHashMap and Weakly Consistent Iterators
- What actually happened
- You assigned 5 to `x`, overwriting its original value
- Lesson 113 — Common Pitfalls: Assignment vs Equality
- What happens
- This code tries to assign `18` to `age`, not compare them.
- Lesson 141 — Common Pitfalls: Assignment vs Comparison
- What it returns
- The number of bytes actually read, or -1 if the end of stream is reached.
- Lesson 1906 — The read(byte[]) and read(byte[], int, int) Methods
- What Java sees
- `x & (MASK == VALUE)` ← compilation error
- Lesson 125 — Common Pitfalls: Precedence and Sign Extension
- What packages you export
- (what the outside world can access)
- Lesson 2462 — The module-info.java File: Location and Purpose
- What they encapsulate
- (implementation details hidden even from reflection)
- Lesson 2461 — Introduction to JPMS and the Module System
- What they export
- (which packages are public API)
- Lesson 2461 — Introduction to JPMS and the Module System
- What they require
- (dependencies on other modules)
- Lesson 2461 — Introduction to JPMS and the Module System
- What this tells you
- Lesson 14 — Understanding Compilation Errors
- What to run
- The `Runnable` task containing your business logic
- Lesson 2710 — The Executor Interface: Decoupling Task Submission from Execution
- What volatile prevents
- Lesson 2688 — Performance Characteristics of volatile
- What you CANNOT do
- You cannot make the thread execute its task.
- Lesson 2581 — NEW State: Thread Creation
- when
- that increment happens relative to using the value in an expression:
- Lesson 97 — Prefix vs Postfix: Evaluation OrderLesson 160 — Choosing Between while and do-whileLesson 2080 — DirectoryStream vs Files.list: When to Use Which
- When appropriate
- Lesson 2453 — Compile-Time vs Runtime Annotation Processing
- When diagnosing deadlock
- Lesson 2703 — Detecting Livelock vs Deadlock
- When diagnosing livelock
- Lesson 2703 — Detecting Livelock vs Deadlock
- When Optional is empty
- Both perform identically (computation runs either way)
- Lesson 1789 — Performance Comparison: orElse vs orElseGet
- When protected is acceptable
- Template Method pattern scenarios where you explicitly design base classes for extension with well-documented extension points.
- Lesson 725 — Avoiding protected: When Inheritance Leaks Implementation
- When to use which
- Lesson 1546 — findFirst vs findAny in Parallel Streams
- When type inference fails
- Occasionally, the compiler cannot infer types, especially with overloaded methods or complex generics.
- Lesson 1706 — Parameter Type Declaration: Explicit Types
- When unsure
- Start with `StringBuilder`—premature thread-safety often causes unnecessary performance loss
- Lesson 2194 — When to Use StringBuilder vs StringBuffer
- While
- there are customers waiting, keep seating people.
- Lesson 156 — The while Loop: Basic Syntax and Execution FlowLesson 1471 — What Are takeWhile and dropWhile?
- Whitelist
- specific classes (only allow these)
- Lesson 2162 — ValidateObjectInputStream and Input Filtering
- why
- you're doing something that might not be obvious
- Lesson 17 — Comments in Java: Single-Line and Multi-LineLesson 1192 — Null Elements and ClassCastException PitfallsLesson 1512 — reduce vs collect: When to Use WhichLesson 2408 — @Deprecated: Marking Outdated APIs
- Why chain constructors
- It eliminates duplication.
- Lesson 323 — Constructor Chaining: Building Complex Initialization
- Why does this matter
- Immutable collections are inherently thread-safe, making them perfect for concurrent environments or when you want to guarantee data won't change after collection.
- Lesson 1557 — toUnmodifiableSet() and toUnmodifiableMap()
- Why is this dangerous
- Lesson 2522 — Split Packages: The Problem JPMS Solves
- Why it fails
- The compiler doesn't know if `numbers` holds `Integer`, `Double`, or some other `Number` subtype.
- Lesson 938 — Common Wildcard Mistakes and Compiler Errors
- Why it works
- A Dog *is-a* Animal.
- Lesson 438 — Real-World is-a Examples: Building Class HierarchiesLesson 726 — Public Interfaces, Package-Private Implementations
- Why reading is problematic
- The compiler doesn't know the *actual* type stored in the collection.
- Lesson 943 — Contravariance with '? super T': Write-Only Semantics
- Why the different rules
- Lesson 1722 — Capturing Instance Variables and Static Fields
- Why this restriction
- Java's regex engine scans text left-to-right and needs to step backward a precise, predictable number of characters when evaluating lookbehinds.
- Lesson 2310 — Lookbehind Limitations in Java
- Why this works
- Lesson 247 — Iterating Arrays with Traditional for LoopsLesson 1104 — Index Calculation: Hash to Bucket Mapping
- Widely-recognized constants
- Lesson 381 — Best Practices for static Imports
- Width
- Minimum number of characters to use
- Lesson 2020 — Format Specifiers: %s, %d, %f, and MoreLesson 2228 — Formatting Numbers with Precision
- Windows
- semicolon (`;`)
- Lesson 690 — Setting the Classpath with -cp and -classpathLesson 1984 — newLine: Platform-Independent Line SeparatorsLesson 2008 — Line Terminator Handling Across PlatformsLesson 2069 — Files.isSymbolicLink() and Files.isHidden()Lesson 2629 — Platform-Dependent Priority Mapping
- Windows (Command Prompt)
- Lesson 691 — The CLASSPATH Environment Variable
- With `&&` (Logical AND)
- Lesson 110 — Short-Circuit Evaluation in && and ||
- With `||` (Logical OR)
- Lesson 110 — Short-Circuit Evaluation in && and ||
- With `dropWhile`
- Lesson 1478 — Performance Characteristics and Short-Circuiting
- With `takeWhile`
- Lesson 1478 — Performance Characteristics and Short-Circuiting
- With BiConsumer
- Lesson 1741 — Method References with Multiple Parameters
- With BiFunction
- Lesson 1736 — Static Method References
- With chaining
- Lesson 319 — Returning this for Method Chaining
- With Consumer
- Lesson 1736 — Static Method References
- With head reference only
- Adding to the front is O(1), but adding to the back requires O(n) traversal.
- Lesson 1021 — Head and Tail References
- With identity and accumulator
- `reducing(T identity, BinaryOperator<T> op)`
- Lesson 1597 — The reducing Collector: General-Purpose Reduction
- With intermediate operations
- , `limit()` and `takeWhile()` restrict how many elements flow through the entire pipeline, so every downstream operation (`map()`, `filter()`, etc.
- Lesson 1416 — Performance Benefits of Short-Circuiting
- With mapper and accumulator
- `reducing(T identity, Function<U,T> mapper, BinaryOperator<T> op)`
- Lesson 1597 — The reducing Collector: General-Purpose Reduction
- With method reference
- Lesson 1570 — Grouping with Method References
- With named groups
- Lesson 2281 — Named Groups and Pattern Maintainability
- With parentheses (always valid)
- Lesson 1700 — Single Parameter Lambda: Parentheses Optional
- With Predicate
- Lesson 1736 — Static Method References
- With red-black trees
- 8 collisions = at most 3 comparisons (O(log 8) = 3)
- Lesson 1117 — Red-Black Trees: The Data Structure Behind Tree Bins
- With reentrancy
- The thread already holds the lock, so it proceeds into `inner()` without blocking.
- Lesson 2671 — What Is Reentrancy?
- With the annotation
- , the compiler catches this immediately:
- Lesson 2416 — Compiler Verification and Error Prevention
- Within the same module
- Works as before—you can access private members
- Lesson 2496 — setAccessible and opens: How They Interact
- within the same package
- .
- Lesson 694 — Class-Level Access Modifiers OverviewLesson 701 — protected Members: Package Plus Subclass AccessLesson 706 — Protected Members and Package Boundaries
- without any access modifier
- , Java applies **package-private** access by default.
- Lesson 328 — Package-Private (Default) AccessLesson 700 — Package-Private Members: Default Package Visibility
- Without chaining
- Lesson 319 — Returning this for Method Chaining
- Without finisher
- (identity finisher): `Collector.
- Lesson 1621 — Collector.of: Building Custom Collectors
- Without identity
- (returns `Optional`): `reducing(BinaryOperator<T> op)`
- Lesson 1597 — The reducing Collector: General-Purpose Reduction
- Without named groups
- Lesson 2281 — Named Groups and Pattern Maintainability
- Without parentheses (cleaner)
- Lesson 1700 — Single Parameter Lambda: Parentheses Optional
- Without reentrancy
- The thread would wait *for itself* to release the lock—instant deadlock.
- Lesson 2671 — What Is Reentrancy?
- Without trees
- 8 collisions = up to 8 comparisons (O(n))
- Lesson 1117 — Red-Black Trees: The Data Structure Behind Tree Bins
- Won't compile
- Lesson 890 — When Raw Types Are Unavoidable
- Work-Stealing Algorithms
- Lesson 1201 — When to Use Deque: Use Cases for Double-Ended Access
- Working with dates only
- Use `LocalDate` for birthdays, holidays, or date ranges.
- Lesson 1856 — Best Practices: When to Use ZonedDateTime
- Working with object streams
- (`Stream<T>`) — you're already dealing with objects
- Lesson 1698 — When to Use Primitive Specializations vs Generics
- Working with primitive streams
- (`IntStream`, `LongStream`, `DoubleStream`) — the API is designed for these types
- Lesson 1698 — When to Use Primitive Specializations vs Generics
- Workload isolation
- Separate CPU-intensive transformations from I/O operations by using distinct pools.
- Lesson 2803 — Using thenApplyAsync with Custom Executor
- Works on a snapshot
- The iterator sees the collection as it existed when the iterator was created
- Lesson 1305 — What Is Fail-Safe Behavior?
- Worst case
- O(n) for arbitrary removal
- Lesson 1041 — Time Complexity: Removal OperationsLesson 1448 — Performance Implications of distinct on Large Streams
- Wrapper classes
- solve this problem.
- Lesson 283 — Wrapper Classes: Boxing Primitives as ObjectsLesson 429 — final Classes in the JDK: String and Wrappers
- Wrapping
- lets you create a new exception that carries the original exception as its *cause*.
- Lesson 769 — Wrapping Exceptions: throw new Exception(cause)
- Wrapping in Optional
- Lesson 2849 — Type Transformation in handle
- Write
- it back
- Lesson 2643 — A Simple Counter ExampleLesson 2644 — Why count++ Is Not AtomicLesson 2685 — volatile Does Not Provide Atomicity for Compound Actions
- Write custom collectors when
- Lesson 1623 — When to Write Custom Collectors vs Compose Existing Ones
- Write-heavy workloads
- Performance degrades as contention increases, especially if writes concentrate on few keys.
- Lesson 1165 — Performance Characteristics: Read vs Write Operations
- writing
- (producing values into the collection), not reading.
- Lesson 935 — Reading from <? super T> Collections Returns ObjectLesson 936 — Comparing extends vs super WildcardsLesson 1917 — Understanding FileOutputStream: Writing Bytes to FilesLesson 1961 — Why Character Streams Exist: The Encoding Problem
- Writing is dangerous
- because Java can't verify type safety.
- Lesson 929 — Wildcard Capture and Reading from <?> Collections
- Writing is forbidden
- Any attempt to modify them breaks the effectively final contract
- Lesson 634 — Accessing Local Variables from Local Classes
- Wrong
- The compiler will reject this code with an error.
- Lesson 964 — Cannot Overload Methods Differing Only by Type ParametersLesson 1324 — Comparing Primitive Fields: Subtraction Pitfalls
- Wrong bucket searched
- `HashMap` looks in bucket 67890, finds nothing, returns `null`—even though `alice1.
- Lesson 557 — Demonstrating the Bug: A Step-by-Step Example
- Wrong number of arguments
- You pass 2 arguments to a method expecting 3
- Lesson 2349 — Type Safety and IllegalArgumentException Risks
- Wrong parameter types
- (a subtle difference you might miss)
- Lesson 423 — Best Practices: Always Use @Override
- Wrong working directory
- Running from the wrong folder means relative paths won't resolve correctly.
- Lesson 693 — Common Classpath Issues and ClassNotFoundException
X
- XML
- offers structured, human-readable data with wide tooling support, though more verbose.
- Lesson 2165 — Alternatives to Java Serialization
Y
- Yes
- → use `do-while`
- Lesson 160 — Choosing Between while and do-whileLesson 532 — Decision Criteria: A Practical ChecklistLesson 789 — When to Use Checked Exceptions: Recoverable ConditionsLesson 1806 — When to Use flatMap vs mapLesson 2165 — Alternatives to Java SerializationLesson 2818 — thenCompose vs thenApply: When to Use WhichLesson 2829 — thenCombine vs thenCompose: Key Differences
- You call `put(key, value)`
- Lesson 1103 — Hash Functions and hashCode() in HashMap
- You can combine both
- An abstract class can implement one or more interfaces, giving you:
- Lesson 532 — Decision Criteria: A Practical Checklist
- You can meaningfully recover
- from the error (e.
- Lesson 744 — Propagating vs Handling: When to Catch vs Declare
- You can write
- Lesson 1422 — Method References in filter
- You have enough context
- to make the right decision about what to do next
- Lesson 744 — Propagating vs Handling: When to Catch vs Declare
- You lack context
- to make recovery decisions (e.
- Lesson 744 — Propagating vs Handling: When to Catch vs Declare
- You must declare it
- in your method signature using `throws`
- Lesson 804 — Introduction to Checked Exceptions
- You must manually cast
- when retrieving, and those casts can fail at runtime
- Lesson 884 — Type Safety Loss with Raw Types
- You need immediate visibility
- Other processes or users must see the data now
- Lesson 1985 — flush: Forcing Buffer Contents to Disk
- You need ordering
- Use `ArrayList` for insertion order or `TreeSet` for sorted order
- Lesson 994 — HashSet: When to Use It
- You need predictable output
- (testing, logging, UI display)
- Lesson 1083 — Choosing Between HashSet and LinkedHashSet
- You need shared state
- Multiple subclasses require common fields or instance variables
- Lesson 532 — Decision Criteria: A Practical Checklist
- You need strong encapsulation
- to protect internal APIs from misuse by other teams or future maintainers
- Lesson 2524 — Migration Strategy: When to Use Module Path vs Classpath
- You want maximum performance
- for add/contains/remove operations
- Lesson 1083 — Choosing Between HashSet and LinkedHashSet
- Your code deserializes it
- , instantiating the attacker's chosen class
- Lesson 2161 — Type Confusion and Class Substitution
- Your module's name
- (its global identifier)
- Lesson 2462 — The module-info.java File: Location and Purpose
Z
- Zero
- if they're equal
- Lesson 269 — Arrays.sort with a ComparatorLesson 299 — When Objects Become Eligible for GCLesson 1069 — How compareTo Determines TreeSet OrderingLesson 1310 — The Comparable<T> InterfaceLesson 1311 — Implementing Comparable in a Custom ClassLesson 1312 — The compareTo Method SignatureLesson 1313 — Return Values: Negative, Zero, PositiveLesson 1319 — The compareTo Method Signature and Return Values (+2 more)
- Zero doesn't mean empty
- `available()` returning `0` doesn't guarantee the stream is at its end—it just means no bytes are immediately ready
- Lesson 1909 — The available() Method and Stream Availability
- Zero limit
- Splits as many times as possible and **discards** trailing empty strings.
- Lesson 2208 — Limit Parameter in split(): Controlling Array Size
- ZonedDateTime
- stores a **full time zone** (like `America/New_York` or `Europe/Paris`) along with the date and time.
- Lesson 1870 — OffsetDateTime vs ZonedDateTime