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

CompletableFuture.join(): retrieving the result

`join()` retrieves a `CompletableFuture` result, waiting for completion if necessary. It declares no checked exceptions, but it can still throw an unchecked exception.

Intermediate · Java SE 21
Java

`CompletableFuture.thenCombine`: Combine Two Results

`thenCombine` creates a new `CompletableFuture` whose value is computed only after both input stages complete normally, for example to add the counts from two independent operations.

Intermediate · Java SE 21
Java

CompletionException — wrapping a task failure

CompletionException is an unchecked exception signaling a failure while completing a task or result. With CompletableFuture, it carries the underlying failure to code retrieving the result through join().

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

Condition: waiting and signalling in Java

Wait for a state change in a loop, carry forward the remaining nanosecond budget, and choose whether to wake one waiter or all of them.

Intermediate · Java SE 21
Java

AEADBadTagException — ciphertext authentication failure

AEADBadTagException means that a Cipher operating in an AEAD mode, such as GCM or CCM, could not verify the authentication tag. Reject the data rather than treating it as successfully decrypted.

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

Cipher: authenticated encryption with AES-GCM

Cipher provides encryption and decryption through Java cryptographic providers. AES-GCM protects data confidentiality and detects modifications; correct use requires a unique IV for each key and verification of the authentication tag.

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

GCMParameterSpec — GCM mode parameters

GCMParameterSpec supplies Cipher with an initialization vector and authentication tag length. The object itself neither encrypts data nor ensures IV uniqueness.

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

Mac: authenticating messages with HMAC

The javax.crypto.Mac class computes a message authentication code using a secret key. Learn how to select HmacSHA256, initialize it with a key, and finish the computation with doFinal.

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

SecretKeySpec — a key from a byte array

SecretKeySpec wraps existing key bytes and an algorithm name. It copies the data but does not check its cryptographic validity.

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

DataInputStream — reading typed binary data

DataInputStream reads primitive values and strings from a binary stream. You must know the field order and encoding; it does not parse numbers written as text.

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

DataOutputStream — writing binary data

DataOutputStream writes primitive values and strings to a binary stream in a defined format. Learn the byte widths, byte order, and limitations of writeUTF.

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

Working with both ends of a Deque

Learn to insert, inspect, and remove elements at either end of a `Deque`, and know when to expect `false`, `null`, or an exception.

Basic · Java SE 21
Java

Double.compare(): compare double values

Compare two primitive `double` values by reading the sign of the result. Learn how the method distinguishes signed zeros and places `NaN` last in ascending order.

Basic · Java SE 21