lang.Cloneable: practical reference
lang.Cloneable: practical reference: Cloneable is a marker checked by Object.clone; it provides no public clone method and default cloning is shallow.
CKTIS / Knowledge base
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
lang.Cloneable: practical reference: Cloneable is a marker checked by Object.clone; it provides no public clone method and default cloning is shallow.
java.lang.Comparable<T> defines objects' natural ordering through compareTo(T o). Its result indicates order, not the distance between values.
java.lang.Enum is the base class of enumeration types. Learn how the overridable toString() method differs from name(), which returns a constant's exact declared name.
lang.Error: practical reference: Error is the base for serious VM or linkage conditions that applications ordinarily should not catch for recovery.
java.lang.Exception represents conditions an application may want to handle. Learn the distinction between checked and unchecked exceptions and the roles of throw, throws, and catch.
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.
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.
lang.IllegalStateException: practical reference: IllegalStateException signals that a call is invalid for the receiver's current state rather than merely for an argument value.
IndexOutOfBoundsException signals an index outside the permitted range. Learn its relationship to RuntimeException, its specialized subclasses, and how to validate an array index explicitly.
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.
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.
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.
java.lang.invoke.MethodType describes a method handle's return type and ordered parameter types. The MethodType.methodType factory creates this immutable description.
VarHandle provides typed access to variables with selectable memory ordering. Learn getAcquire, setRelease, and compareAndSet, and distinguish data publication from an atomic update.
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.
Math provides static numeric operations. Learn Math.abs and Math.min, including their behavior for extreme integers, NaN, and signed zero.
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.
lang.Record: practical reference: Record is the implicit superclass of record classes, whose state is defined by components and generated value-oriented members.
java.lang.reflect.Constructor<T> describes one constructor of class T. It exposes parameter types and annotations and can create objects, subject to access checks and Java SE 21 module boundaries.
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.
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.
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.
lang.reflect.ParameterizedType: practical reference: ParameterizedType models a parameterized type such as List<String>, separating raw type from actual type arguments.
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.