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

IllegalArgumentException — invalid argument

IllegalArgumentException signals that a method received an illegal or inappropriate argument. It is an unchecked exception: the compiler does not require callers to catch it or declare it with throws.

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

IllegalMonitorStateException — missing monitor ownership

IllegalMonitorStateException indicates, among other cases, a call to wait(), notify(), or notifyAll() without owning the target object's monitor. Fixing it requires synchronization on the correct object, not merely catching the exception.

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

lang.IllegalStateException: practical reference

lang.IllegalStateException: practical reference: IllegalStateException signals that a call is invalid for the receiver's current state rather than merely for an argument value.

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

IndexOutOfBoundsException — index outside the valid range

IndexOutOfBoundsException signals an index outside the permitted range. Learn its relationship to RuntimeException, its specialized subclasses, and how to validate an array index explicitly.

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

InterruptedException — handling thread interruption

InterruptedException is a checked exception signaling interruption of an operation such as Thread.sleep. Learn how the exception differs from the interrupt flag and how to preserve the signal when handling it.

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

MethodHandle: argument binding and typed invocation

MethodHandle is a typed reference to an operation. Learn how bindTo binds its first argument and how strict invokeExact differs from type-adapting invoke in Java SE 21.

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

MethodHandles — typed handles for methods and fields

MethodHandles provides factories and transformations for handles. A Lookup object controls access when handles are created; findVirtual creates an instance-method handle, while findVarHandle provides access to an instance field.

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

MethodType — describing parameter and return types

java.lang.invoke.MethodType describes a method handle's return type and ordered parameter types. The MethodType.methodType factory creates this immutable description.

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

VarHandle: acquire-release access and atomic CAS

VarHandle provides typed access to variables with selectable memory ordering. Learn getAcquire, setRelease, and compareAndSet, and distinguish data publication from an atomic update.

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

Iterable — a contract for traversing elements

java.lang.Iterable<T> enables an object to be used in an enhanced for loop. Its iterator() method supplies an iterator, while the default forEach() method applies an action to successive elements.

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

java.lang.Math — absolute value and minimum

Math provides static numeric operations. Learn Math.abs and Math.min, including their behavior for extreme integers, NaN, and signed zero.

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

NullPointerException — using null instead of an object

NullPointerException (NPE) signals the use of null where an object is required. It extends RuntimeException, so it does not need to be declared in throws.

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

lang.Record: practical reference

lang.Record: practical reference: Record is the implicit superclass of record classes, whose state is defined by components and generated value-oriented members.

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

Field — reflective field access in Java

java.lang.reflect.Field describes one field and enables access to its value at runtime. It supports inspecting metadata and annotations and changing values, subject to access-control and module-system restrictions.

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

InvocationHandler — handling dynamic proxy calls

InvocationHandler defines how a dynamic proxy's methods behave. Learn the InvocationHandler.invoke contract, its arguments, return-value and exception constraints, and handling of Object methods.

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

java.lang.reflect.Method — inspecting and invoking a method

A Method object represents a method accessed through reflection. It lets you inspect its name and annotations and invoke it at runtime. Suppressing access checks with setAccessible remains subject to module boundaries.

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

lang.reflect.ParameterizedType: practical reference

lang.reflect.ParameterizedType: practical reference: ParameterizedType models a parameterized type such as List<String>, separating raw type from actual type arguments.

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

java.lang.reflect.Proxy — dynamic interface proxies

Proxy.newProxyInstance creates an object implementing specified interfaces at runtime. Calls go to an InvocationHandler, which determines the result instead of using an ordinary method implementation.

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

Runnable — a task without a return value

Runnable describes an operation with no parameters and no return value. Its run() method defines the task's action; calling that method alone does not start a new thread.

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

lang.RuntimeException: practical reference

lang.RuntimeException: practical reference: RuntimeException is the unchecked exception base; callers are not required to catch or declare it.

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

StackOverflowError — call stack overflow

The JVM can throw StackOverflowError when a computation needs more stack space than the thread is allowed. Deep recursion is a common cause, but a sufficiently deep nonrecursive call chain can also overflow the stack. The error belongs to the Error hierarchy, not Exception; addressing it usually means fixing the method-call structure rather than catching the error.

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

lang.StrictMath: practical reference

lang.StrictMath: practical reference: StrictMath provides reproducible core transcendental algorithms with specified fdlibm-based results where documented.

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

lang.StringBuffer: practical reference

lang.StringBuffer: practical reference: StringBuffer is a mutable synchronized character sequence; individual methods are synchronized but compound protocols need coordination.

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