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

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
Java

DoubleStream: counting and averaging CPU loads

Build a stream of primitive doubles, select CPU loads at or above `0.50`, and calculate the count and mean separately for all readings and for high readings.

Intermediate · Java SE 21