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

Collectors.mapping: practical reference

Collectors.mapping: practical reference: Collectors.mapping applies a mapping function to each input and forwards the mapped values to a downstream collector.

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

Collectors.partitioningBy: practical reference

Collectors.partitioningBy: practical reference: Collectors.partitioningBy divides input into exactly two Boolean-keyed groups according to a predicate, with an optional downstream collector.

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

Collectors.toList: practical reference

Collectors.toList: practical reference: Collectors.toList accumulates stream elements into a List while making no promise about the concrete list type, serializability, thread safety, or mutability.

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

Collectors.toMap: practical reference

Collectors.toMap: practical reference: Collectors.toMap creates a Map from key and value mapping functions; overloads control duplicate-key merging and the concrete map supplier.

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

Collectors.toSet: practical reference

Collectors.toSet: practical reference: Collectors.toSet accumulates elements into a Set and therefore removes duplicates, but it does not guarantee set type, order, mutability, serializability, or thread safety.

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

Reverse a comparator with Comparator.reversed()

`Comparator.reversed()` returns a comparator that orders elements in the opposite direction from an existing comparator. The call itself does not sort or change a list.

Basic · Java SE 21
Java

CompletableFuture.join(): retrieving the result

`join()` retrieves a `CompletableFuture` result, waiting for completion if necessary. It declares no checked exceptions, but it can still throw an unchecked exception.

Intermediate · Java SE 21
Java

`CompletableFuture.thenCombine`: Combine Two Results

`thenCombine` creates a new `CompletableFuture` whose value is computed only after both input stages complete normally, for example to add the counts from two independent operations.

Intermediate · Java SE 21
Java

CompletionException — wrapping a task failure

CompletionException is an unchecked exception signaling a failure while completing a task or result. With CompletableFuture, it carries the underlying failure to code retrieving the result through join().

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