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.
CKTIS / Knowledge base
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
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.
lang.RuntimeException: practical reference: RuntimeException is the unchecked exception base; callers are not required to catch or declare it.
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.
lang.StrictMath: practical reference: StrictMath provides reproducible core transcendental algorithms with specified fdlibm-based results where documented.
lang.StringBuffer: practical reference: StringBuffer is a mutable synchronized character sequence; individual methods are synchronized but compound protocols need coordination.
StringBuilder lets you build and modify text incrementally. Learn the difference between length and capacity, and what happens when setLength truncates or extends the sequence.
lang.System: practical reference: System exposes standard streams, properties, environment, time sources, array copying, and VM-level utilities.
java.lang.Thread represents a thread of execution. Learn to create a thread with Runnable, launch it with start(), wait with join(), and use cooperative interruption without relying on timing delays.
ThreadLocal stores a separate value for each thread. Learn lazy initialization, reading, writing, and removal, and why cleanup matters for tasks running in a thread pool.
java.lang.Throwable is the base of the exception and error hierarchy. Distinguish its message, cause, and suppressed exceptions.
java.math.BigDecimal supports arbitrary-precision decimal numbers, useful for monetary calculations and similar tasks. Learn value construction, arithmetic, scale, comparison, and explicit rounding.
math.BigInteger: practical reference: BigInteger represents immutable arbitrary-precision integers and defines two-complement-style bit operations.
math.MathContext: practical reference: MathContext combines decimal precision and rounding mode for BigDecimal operations; precision zero means unlimited.
java.math.RoundingMode specifies a rounding policy used by APIs such as BigDecimal. HALF_UP chooses the nearest value and breaks ties away from zero, including for negative numbers.
MalformedURLException is a checked exception in java.net that extends IOException. It signals a URL construction problem, such as an unrecognized protocol or input rejected by its handler; it does not mean that a connection failed.
java.net.URL(String) creates a URL object from text. The constructor has been deprecated since Java 20; Java SE 21 recommends using URI and converting with toURL().
nio.Buffer: practical reference: Buffer is the base NIO buffer state machine, maintaining capacity, limit, position, and an optional mark.
ByteBuffer stores bytes and supports reading and writing binary values. Learn buffer creation, byte order, and how flip, clear, and compact control position and limit.
nio.ByteOrder: practical reference: ByteOrder represents BIG_ENDIAN and LITTLE_ENDIAN ordering for multibyte buffer access.
CharBuffer holds char values within a range controlled by position and limit. Learn position-relative indexing and the difference between a shared read-only view and a copy of the data.
java.nio.charset.Charset describes a mapping between Unicode code units and bytes. Learn how Charset.forName selects an encoding and how to create a decoder and encoder with explicit error handling.
CharsetDecoder converts bytes in a selected charset into Unicode characters. It independently configures handling of malformed and unmappable sequences: reporting errors, replacing input, or ignoring input.
CharsetEncoder converts Unicode characters into bytes in a selected charset. It supports explicit error handling and encoding either a complete buffer or successive chunks of text.
StandardCharsets provides ready-made Charset objects for standard encodings required by the Java platform. Use StandardCharsets.UTF_8 or StandardCharsets.UTF_16BE to specify explicitly how text becomes bytes and how bytes become text.