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

RecursiveTask — a recursive result-bearing task

RecursiveTask<V> represents a fork/join task that returns a result of type V. Its compute() method defines the computation: handle a small problem directly or split it into subtasks and combine their results.

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

Reference: get(), clear(), and reachabilityFence()

Reference provides operations on reference objects. Learn referent retrieval, reference clearing, and strong-reachability control in Java SE 21.

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

ReferenceQueue — receiving reference objects

ReferenceQueue lets you retrieve registered reference objects after the garbage collector or an explicit enqueue() adds them. Learn the difference between nonblocking poll() and the blocking remove() variants.

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

Reference.reachabilityFence — preserving strong reachability

Reference.reachabilityFence(ref) keeps an object strongly reachable at least until the call completes. It is useful when premature reclamation could interfere with an operation.

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

Array.newInstance — creating arrays dynamically

Array.newInstance creates arrays from a Class<?> object. It supports primitive types, reference types, and multiple dimensions.

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

Java reflection: accessing fields and methods

In Java SE 21, `Field` and `Method` let you inspect metadata and annotations, change field values, and invoke methods. Finding a private member does not grant access, and `setAccessible(true)` is subject to module rules.

Advanced · Java SE 21
Java

ResolverStyle — strict date resolution

ResolverStyle controls how parsed fields become a date or time. The behavior of ResolverStyle.STRICT depends on the fields: for an ISO calendar date given as year, month, and day, it rejects February 29 in a non-leap year.

Intermediate · Java SE 21 (documentation scope); repository and production runtimes not attested
Java

Closing a scanner: Scanner.close()

`Scanner.close()` closes a scanner and can also close its input source. Learn when to call it and why shared standard input needs special care.

Basic · Java SE 21
Java

Scanner.nextDouble() — read a double value

`Scanner.nextDouble()` reads the next input token as a primitive `double`. The scanner’s locale controls which decimal and grouping separators it recognizes.

Basic · Java SE 21
Java

Scanner.nextInt(): read an integer

Read the next token as an `int`, check whether it is valid before reading, and see why a following `nextLine()` can return an empty string.

Basic · Java SE 21
Java

SecureRandom — cryptographic randomness

SecureRandom generates cryptographically strong random values. nextBytes fills the supplied byte array.

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

Set.add — Add an element without duplicates

`Set.add` returns `true` when it inserts an element and `false` when an equivalent element is already present. `HashSet` and `TreeSet` identify duplicates differently.

Basic · Java SE 21