Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / Knowledge base

Knowledge base

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

Entries: 5788

Java

util.BitSet: practical reference

util.BitSet: practical reference: BitSet is a growable packed bit vector whose logical length is the highest set bit plus one, not its storage capacity.

Intermediate · Java SE 21 (JLS and Java SE API); examples verified on the repository Java runtime
Java

Collection — size, emptiness, and streams

java.util.Collection<E> describes a group of elements. Learn how to check size and emptiness and distinguish sequential from possibly parallel streams in Java SE 21.

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

Collections — collection algorithms and views

java.util.Collections provides static collection operations. Learn sorting, element swapping, and unmodifiable and synchronized views in Java SE 21.

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

Comparator — composing ordering rules

java.util.Comparator describes an ordering independently of the objects' class. It lets you combine keys, reverse direction, and handle null explicitly for both whole elements and their fields.

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

ArrayBlockingQueue — a fixed-capacity blocking queue

ArrayBlockingQueue is a thread-safe FIFO queue backed by a fixed-capacity array. It transfers elements between producers and consumers and lets callers choose between waiting and receiving an immediate operation result.

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

util.concurrent.atomic.AtomicBoolean: practical reference

util.concurrent.atomic.AtomicBoolean: practical reference: AtomicBoolean provides atomic boolean reads, writes, compare-and-set, and memory-effect variants.

Advanced · Java SE 21 (JLS and Java SE API); examples verified on the repository Java runtime
Java

AtomicInteger — atomic operations on int

AtomicInteger provides atomic operations on a single int value shared between threads. Learn reading, writing, incrementing, and conditional updates, including the limits of atomicity.

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

AtomicLong — an atomic long counter

AtomicLong holds one long value and provides atomic updates shared by threads. Its incrementAndGet() method increases the value by one and returns the updated result.

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

AtomicReference — updating a reference atomically

AtomicReference<V> provides atomic operations on one reference. Learn how get(), conditional compareAndSet(), and unconditional getAndSet() differ, and why object identity rather than content equality determines whether a conditional replacement succeeds.

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

LongAccumulator — concurrent aggregation of long values

LongAccumulator combines long values using a supplied function. It supports concurrent updates, but get() does not provide an atomic snapshot while updates are occurring.

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

LongAdder — concurrent counting and summation

LongAdder maintains a long sum updated by multiple threads. It suits statistics, but sum() does not provide an atomic snapshot, and resetting requires control over concurrent updates.

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

BlockingQueue — a queue with waiting operations

BlockingQueue<E> supports safe exchange of elements between threads, such as a producer and a consumer. It distinguishes operations that do not wait for space or elements, waiting operations, and timed variants. The example uses an ArrayBlockingQueue with capacity 1.

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

util.concurrent.Callable: practical reference

util.concurrent.Callable: practical reference: Callable<V> is a functional interface for a no-argument task that returns V and may throw Exception.

Advanced · Java SE 21 (JLS and Java SE API); examples verified on the repository Java runtime
Java

CompletableFuture — composing asynchronous computations

CompletableFuture<T> represents a future result and lets you connect dependent stages without blocking after every step. Learn transformations, composition, result combination, error recovery, and timeouts in Java SE 21.

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

util.concurrent.CompletionService: practical reference

util.concurrent.CompletionService: practical reference: CompletionService<V> separates task submission from retrieving Future results in completion order.

Advanced · Java SE 21 (JLS and Java SE API); examples verified on the repository Java runtime
Java

util.concurrent.CompletionStage: practical reference

util.concurrent.CompletionStage: practical reference: CompletionStage<T> describes a computation stage that performs an action or computes a value when another stage completes.

Advanced · Java SE 21 (JLS and Java SE API); examples verified on the repository Java runtime
Java

ConcurrentHashMap — a concurrent key–value map

ConcurrentHashMap lets multiple threads safely use a shared map. Atomic operations for a key do not, however, turn a sequence of calls into a transaction.

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

ConcurrentLinkedQueue — concurrent FIFO queue

Learn ConcurrentLinkedQueue and its add, isEmpty, and poll methods for insertion, empty checks, and safe retrieval.

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

util.concurrent.CopyOnWriteArrayList: practical reference

util.concurrent.CopyOnWriteArrayList: practical reference: CopyOnWriteArrayList<E> is a thread-safe list that copies its entire backing array on every mutation.

Advanced · Java SE 21 (JLS and Java SE API); examples verified on the repository Java runtime
Java

CountDownLatch — one-shot waiting for signals

CountDownLatch coordinates threads: await() waits until countDown() calls reduce the count to zero. It supports waiting for a group of operations and guarantees visibility of earlier writes.

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

CyclicBarrier — cyclic thread synchronization

CyclicBarrier synchronizes a fixed number of participants at successive phase boundaries. Calling await() waits for the others; an optional action combines results before the next phase begins.

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

Executor — separating tasks from execution policy

java.util.concurrent.Executor accepts Runnable tasks through execute. It separates task submission from execution policy; it guarantees neither a separate thread nor asynchronous execution.

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

Executors — creating a fixed-size thread pool

java.util.concurrent.Executors provides factory methods for task executors. Executors.newFixedThreadPool limits the number of active worker threads, but not the queue size. Learn how to retrieve results and close the pool in Java SE 21.

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

ExecutorService — tasks, results, and shutdown

ExecutorService separates task submission from execution management. Learn submit, bulk execution with invokeAll, and shutdown, including the distinction between requesting shutdown and waiting for termination.

Intermediate · Java SE 21 (repository runtime); production runtime not attested