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

@Override — checking method overriding

The @Override annotation lets the compiler check whether a method overrides a supertype method or implements an interface method. It helps catch typos and accidental overloads; it does not itself change the method's runtime behavior.

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

@SafeVarargs — declaring safe varargs handling

`@SafeVarargs` is the author's assertion that a method or constructor handles its varargs parameter safely. It suppresses specific unchecked warnings at the declaration and call sites, but neither checks nor repairs type safety.

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

@SuppressWarnings — suppressing compiler warnings

@SuppressWarnings suppresses selected warning categories in an annotated declaration and its contents. It neither repairs code nor guarantees type safety; use the smallest effective scope and explain the reason.

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

AbstractMap.toString — a map's string representation

AbstractMap.toString returns text containing key–value mappings. Their order comes from the entrySet() iterator, not from automatic sorting.

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

array.clone() — a shallow array copy

array.clone() creates a new array containing copies of its component values. Primitive values are independent, but references still point to the same objects; in multidimensional arrays, subarrays remain shared.

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

ArrayDeque as a FIFO queue

Use `ArrayDeque` to add elements at the back, remove them from the front, and check how many are left or whether the queue is empty.

Intermediate · Java SE 21
Java

array.length — array length

The expression array.length reads the number of array elements as an int. length is a public final field, not a method: the syntax has no parentheses, and an existing array's length cannot be changed.

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

Arrays.asList — a fixed-size list backed by an array

Arrays.asList creates a fixed-size list view of an array. Elements can be replaced, but the size cannot change; the list and array share their data.

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

Arrays.binarySearch — searching a sorted array

Arrays.binarySearch searches a sorted array. It returns the matching index or a negative result encoding the insertion point.

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

Arrays.copyOf — copying an array with a different length

Arrays.copyOf creates a new array of a specified length. For int[], it removes trailing elements or fills extra positions with zeros without changing the original.

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

Arrays.sort — sorting an int[] array

Arrays.sort orders int[] values in ascending order, modifying the supplied array. You can sort the entire array or a selected index range.

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

AtomicIntegerFieldUpdater — atomic updates to an int field

AtomicIntegerFieldUpdater provides atomic operations on an existing object's volatile int field. One updater can serve multiple instances of a class, without a separate AtomicInteger object for each field.

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

Base64 — encoding and decoding bytes

The java.util.Base64 class represents bytes as Base64 text and recovers them by decoding. Learn the Basic variant, explicit UTF-8 conversion, and handling of malformed input.

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

Base64 in Java: encoding and decoding bytes

Use `java.util.Base64` to represent bytes as text and recover the original bytes. Base64 is reversible and provides neither confidentiality nor integrity.

Advanced · Java SE 21