Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / Knowledge base

Knowledge base

Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.

Entries: 5788

Java

Scope and lifetime

Scope and lifetime: Lexical scope determines where a name is visible, while object lifetime follows reachability; try-with-resources closes a resource deterministically.

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

Security and password hashing

Security and password hashing: Java security requires trust-boundary validation, least privilege, and platform cryptography; password hashing should use a slow KDF rather than raw MessageDigest.

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

Sorting and comparators

Sorting and comparators: List.sort and object Arrays.sort order stably by a Comparator, so elements equal under the order retain their prior encounter order.

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

Staged builder through interfaces

Staged builder through interfaces splits object construction into typed steps. Each stage-transition method returns the next stage's interface, so an ordinary call chain exposes `build()` only after the required inputs have been supplied. This does not replace runtime validation of those inputs.

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

Java Stream pipelines

Java Stream pipelines: A Stream is a single-use lazy pipeline of a source, intermediate operations, and a terminal operation; elements flow only when the terminal requests a result.

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

Strings and Unicode

Strings and Unicode: String is an immutable sequence of UTF-16 code units; length counts code units, so a supplementary character occupies two chars but one code point.

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

Deterministic testing

Deterministic testing: A deterministic test arranges input, executes one behavior, and checks an observable result; a unit test isolates the contract of a small unit.

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

Time and zones in Java

Time and zones in Java: The java.time API separates an Instant on the timeline, a Duration, a LocalDate, and a ZonedDateTime governed by ZoneId rules.

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

Type conversions in Java

Type conversions in Java: Java performs implicit widening conversions, while primitive narrowing and reference casts require explicit syntax; boxing connects a primitive with its wrapper.

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

Type erasure and class tokens in Java

Type erasure gives `ArrayList<String>` and `ArrayList<Integer>` the same runtime class, but reflection can still read a type argument from a field declaration.

Advanced · Java SE 21
Java

Java type system

Java type system: Java has a static, nominal type system that distinguishes primitive from reference types and derives subtyping from declared inheritance and interface implementation.

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

Value-based classes and object identity

Compare instances of value-based classes such as LocalDate using equals, not reference identity. Treat equal values as interchangeable and never use them as synchronization locks.

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

Variables and scope in Java

Variables and scope in Java: A Java variable has a declared or inferred type, scope, and lifetime; variables include fields, parameters, local variables, and array components.

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

Virtual threads in Java

Virtual threads in Java: A Java 21 virtual thread is a lightweight Thread implementation scheduled by the JVM for very large numbers of concurrent, mostly blocking tasks.

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

Java byte order: LITTLE_ENDIAN and BIG_ENDIAN

Choose how `ByteBuffer` lays out multibyte values, use the same byte order to write and read them, and distinguish the buffer default from the platform’s native order.

Advanced · Java SE 21
Java

int limits: Integer.MIN_VALUE and Integer.MAX_VALUE

Integer.MIN_VALUE and Integer.MAX_VALUE define the lower and upper bounds of Java's int type. Learn their values and the difference between int overflow and a calculation performed as long.

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

TimeUnit: fixed units of elapsed time

`TimeUnit` provides seven units from nanoseconds to days. Choose the unit that matches an amount, or convert different amounts to a common unit.

Advanced · Java SE 21
Java

NumberFormatException — failed text-to-number conversion

NumberFormatException signals that text cannot be converted to the requested numeric type. With Integer.parseInt, the cause can be either invalid notation or a value outside the int range.

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

UnsupportedOperationException — unsupported operation

UnsupportedOperationException means that the requested operation is not supported. It commonly occurs when attempting to modify an unmodifiable list, such as one created with List.of(...). The solution is to choose an object that supports the required operation, not merely catch the exception.

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

The abstract keyword

The abstract keyword: The abstract keyword marks an incomplete class that cannot be instantiated with new, or a bodyless method that a concrete subclass must implement.

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

The assert statement

The assert statement: The assert statement checks an internal assumption and throws AssertionError on failure, optionally carrying the value of the expression after the colon.

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

The break statement

The break statement: An unlabeled break statement exits the nearest loop or switch statement, while a labeled break transfers control beyond its labeled block or loop.

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