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

ChronoUnit.DAYS.between — days between dates

ChronoUnit.DAYS.between(start, end) returns the number of complete days as a long. For LocalDate, it calculates the calendar-date difference; an end before the start produces a negative result.

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

Reading class annotations with reflection

Read repeatable annotations as an array and test for a marker annotation. Distinguish inherited lookup from lookup restricted to the class declaration.

Advanced · Java SE 21
Java

Class.cast — checked casting with Class<T>

When you have the target type in a `Class<T>` variable, use `cast` to get a reference of type `T` to the same object. Use `isInstance` to check a non-null value before casting.

Intermediate · Java SE 21
Java

Class.getName() — type names in Java

`Class.getName()` returns the name of the represented type. For ordinary classes and interfaces, this is the binary name; arrays use a different notation.

Intermediate · Java SE 21
Java

Cleaner — explicit and fallback cleanup

Cleaner registers a cleanup action. Invoke it explicitly through Cleanable.clean(); automatic execution is a fallback mechanism.

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

CodingErrorAction: reporting and replacing invalid input

CodingErrorAction controls how a charset decoder or encoder handles coding errors. REPORT exposes an error to the caller, while REPLACE substitutes the configured replacement and continues processing. Malformed input and unmappable characters have independently configured policies.

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

Collection.spliterator — traversing collection elements

Collection.spliterator() returns an object for traversing collection elements and potentially partitioning the work. Learn the default implementation, size characteristics, and limitations around modification and concurrency.

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

Collections.sort — sorting a list in Java

Sort an existing list by its elements’ natural order or by a comparator. Both overloads modify the same list and preserve the relative order of elements that compare as equal.

Basic · Java SE 21