JavaReadWriteLock exposes associated read and write locks: multiple readers can share access, while writing requires exclusive access. Learn readLock() and writeLock(), visibility guarantees, and safe lock release.
Intermediate · Java SE 21; repository runtime, production runtime not attestedJavaReentrantLock provides mutual exclusion while allowing its owner to acquire the same lock repeatedly. It requires explicit release and also offers tryLock() and associated Condition objects.
Intermediate · Java SE 21; repository runtime, production runtime not attestedJavautil.concurrent.locks.ReentrantReadWriteLock: practical reference: ReentrantReadWriteLock provides a shared read lock and an exclusive write lock with reentrancy.
Advanced · Java SE 21 (JLS and Java SE API); examples verified on the repository Java runtimeJavaStampedLock provides exclusive writing, shared reading, and optimistic reading with validation.
Advanced · Java SE 21; repository runtime, production runtime not attestedJavaConcurrentModificationException reports a detected modification that an object's contract forbids. It can occur in a single thread; it is neither a synchronization mechanism nor a guaranteed bug detector.
Intermediate · Java SE 21; repository runtime, production runtime not attestedJavaPhaser is a reusable synchronization barrier with a variable number of participants. It lets tasks wait for a stage to finish and deregister when their work ends.
Intermediate · Java SE 21; repository runtime, production runtime not attestedJavautil.concurrent.ScheduledExecutorService: practical reference: ScheduledExecutorService schedules one-shot tasks after relative delays and recurring tasks periodically.
Advanced · Java SE 21 (JLS and Java SE API); examples verified on the repository Java runtimeJavajava.util.concurrent.Semaphore limits access using a permit counter. Learn blocking acquire(), nonblocking tryAcquire(), and safe permit return using release().
Intermediate · Java SE 21; repository runtime, production runtime not attestedJavautil.concurrent.StructuredTaskScope: practical reference: StructuredTaskScope<T> is a Java 21 preview API that confines concurrent subtask lifetimes to a structured scope.
Advanced · Java SE 21 (JLS and Java SE API); examples verified on the repository Java runtimeJavautil.concurrent.SubmissionPublisher: practical reference: SubmissionPublisher<T> asynchronously delivers non-null items to current Flow.Subscribers through an independent buffer per subscriber.
Advanced · Java SE 21 (JLS and Java SE API); examples verified on the repository Java runtimeJavaTimeUnit describes time units used in operations such as timeouts. It converts long values, truncating fractional parts or saturating on overflow.
Basic · Java SE 21; repository runtime, production runtime not attestedJavaDate represents an instant with millisecond precision. Learn to read it with getTime(), change it with setTime(long), and compare it with equals(Object).
Basic · Java SE 21; repository runtime, production runtime not attestedJavajava.util.Deque<E> describes a double-ended queue: elements can be added and removed at either end. The same interface supports a FIFO queue and a LIFO stack; the methods you choose determine the behavior.
Basic · Java SE 21; repository runtime, production runtime not attestedJavaDoubleSummaryStatistics collects the count, sum, minimum, maximum, and average of double values. accept adds a value, while combine merges statistics.
Basic · Java SE 21; repository runtime, production runtime not attestedJavaEnumMap stores keys from one enum type. The example demonstrates construction, insertion, lookup, size, and iteration in enum declaration order.
Basic · Java SE 21; repository runtime, production runtime not attestedJavaEnumSet stores constants of one enum type without duplicates. Learn to create sets with of and allOf and use the add, remove, and contains operations.
Basic · Java SE 21; repository runtime, production runtime not attestedJavautil.function.BiConsumer: practical reference: BiConsumer<T,U> is a functional operation that accepts two arguments, returns no result, and is normally intended for side effects.
Intermediate · Java SE 21 (JLS and Java SE API); examples verified on the repository Java runtimeJavautil.function.BiFunction: practical reference: BiFunction<T,U,R> is a functional interface that maps two potentially different argument types to one result R.
Intermediate · Java SE 21 (JLS and Java SE API); examples verified on the repository Java runtimeJavautil.function.BinaryOperator: practical reference: BinaryOperator<T> specializes BiFunction<T,T,T> so both operands and the result have the same type.
Intermediate · Java SE 21 (JLS and Java SE API); examples verified on the repository Java runtimeJavautil.function.BiPredicate: practical reference: BiPredicate<T,U> is a functional interface that tests a pair of arguments and returns a boolean.
Intermediate · Java SE 21 (JLS and Java SE API); examples verified on the repository Java runtimeJavaConsumer<T> accepts one argument and returns no value. It represents actions with side effects; accept runs the operation, while andThen combines two operations that run in sequence.
Basic · Java SE 21; repository runtime, production runtime not attestedJavaFunction<T, R> describes an operation that accepts one argument and returns a result. Learn apply, the execution order of andThen and compose, and the identity function.
Basic · Java SE 21; repository runtime, production runtime not attestedJavautil.function.IntConsumer: practical reference: IntConsumer is the primitive specialization of Consumer for an int argument, with resultless accept(int) and no input boxing.
Intermediate · Java SE 21 (JLS and Java SE API); examples verified on the repository Java runtimeJavautil.function.IntFunction: practical reference: IntFunction<R> is a functional interface that maps a primitive int argument to a reference result R without boxing the input.
Intermediate · Java SE 21 (JLS and Java SE API); examples verified on the repository Java runtime