Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / Java

Knowledge base — Java

Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.

Entries: 813

Java

ReadWriteLock — separate read and write locks

ReadWriteLock 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 attested
Java

ReentrantLock — explicit reentrant mutual exclusion

ReentrantLock 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 attested
Java

util.concurrent.locks.ReentrantReadWriteLock: practical reference

util.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 runtime
Java

StampedLock — optimistic reading

StampedLock provides exclusive writing, shared reading, and optimistic reading with validation.

Advanced · Java SE 21; repository runtime, production runtime not attested
Java

Phaser — synchronizing work stages

Phaser 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 attested
Java

util.concurrent.ScheduledExecutorService: practical reference

util.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 runtime
Java

Semaphore — limiting concurrent access

java.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 attested
Java

util.concurrent.StructuredTaskScope: practical reference

util.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 runtime
Java

util.concurrent.SubmissionPublisher: practical reference

util.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 runtime
Java

TimeUnit — time units and conversions

TimeUnit 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 attested
Java

java.util.Date — reading, changing, and comparing time

Date 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 attested
Java

Deque — double-ended queue and stack

java.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 attested
Java

DoubleSummaryStatistics — statistics for double values

DoubleSummaryStatistics 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 attested
Java

EnumMap — a map with enum keys

EnumMap 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 attested
Java

EnumSet — a set of constants from one enum type

EnumSet 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 attested
Java

util.function.BiConsumer: practical reference

util.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 runtime
Java

util.function.BiFunction: practical reference

util.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 runtime
Java

util.function.BinaryOperator: practical reference

util.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 runtime
Java

util.function.BiPredicate: practical reference

util.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 runtime
Java

Consumer<T> — an operation with no result value

Consumer<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 attested
Java

Function — transforming values and composing functions

Function<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 attested
Java

util.function.IntConsumer: practical reference

util.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 runtime
Java

util.function.IntFunction: practical reference

util.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