StringBuilder — a mutable text buffer
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.
CKTIS / Java
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
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.
nio.file.Files: practical reference: Files provides file operations whose atomicity, attributes, and behavior depend on the selected method and file-system provider.
nio.file.Path: practical reference: Path is an immutable file-system path value; it need not name an existing file until an I/O operation resolves it.
nio.file.Paths: practical reference: Paths is a factory delegating path construction to the default file system or a URI provider.
nio.file.StandardOpenOption: practical reference: StandardOpenOption enumerates file-open policies such as CREATE, TRUNCATE_EXISTING, APPEND, and SYNC.
nio.IntBuffer: practical reference: IntBuffer is an int-specialized NIO buffer with independent position/limit state and optional array or direct backing.