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

util.Random: practical reference

util.Random: practical reference: Random generates a pseudorandom sequence with a 48-bit linear algorithm; the same seed and identical call sequence produce the same values.

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

Matcher — checking text and reading matches

java.util.regex.Matcher applies a regular expression to text. matches() checks the entire region, find() searches for successive substrings, and group() reads the result of a successful match.

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

Pattern — a compiled regular expression

java.util.regex.Pattern stores a compiled regular expression. Pattern.compile creates the pattern, and Pattern.matcher creates a Matcher for checking an entire input or searching for matching subsequences.

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

util.regex.PatternSyntaxException: practical reference

util.regex.PatternSyntaxException: practical reference: PatternSyntaxException is an unchecked IllegalArgumentException that reports a syntax error while a regular-expression pattern is compiled.

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

Scanner — reading numbers and lines

java.util.Scanner reads text tokens and lines. Distinguish reading a number from reading the remainder of a line, and configure number formatting explicitly.

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

util.SequencedCollection: practical reference

util.SequencedCollection: practical reference: SequencedCollection<E> defines a collection with a well-defined encounter order, operations at both ends, and a reverse-ordered view.

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

util.SequencedMap: practical reference

util.SequencedMap: practical reference: SequencedMap<K,V> is a map with a defined encounter order for mappings, operations on its first and last entries, and a reverse-ordered view.

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

util.SequencedSet: practical reference

util.SequencedSet: practical reference: SequencedSet<E> combines Set uniqueness with a defined encounter order, end operations, and a reversed view whose type remains SequencedSet.

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

util.ServiceLoader: practical reference

util.ServiceLoader: practical reference: ServiceLoader<S> locates zero, one, or many service providers in the runtime environment and loads them lazily without exposing implementation locations.

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

java.util.Set — a collection without duplicates

Set<E> describes a collection of unique elements. Learn how to add, check, remove, and count elements, and distinguish the Set interface from the HashSet implementation.

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

SortedMap — a map ordered by keys

SortedMap orders keys by their natural ordering or a comparator. firstKey() and lastKey() return the endpoint keys in that ordering; both throw an exception for an empty map.

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

Spliterator — traversing elements and partitioning work

java.util.Spliterator supports reading elements and partitioning the remaining range. Source characteristics describe properties such as ordering and size accuracy; splitting alone does not start parallel execution.

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

Collector — custom mutable stream reduction

Collector<T, A, R> describes accumulating stream elements into mutable state and transforming it into a result. Learn the collector functions, parallel-processing requirements, and the meaning of its characteristics in Java SE 21.

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

Collectors: summary statistics and concurrent grouping

The java.util.stream.Collectors class supplies collectors for Stream.collect. Combine Collectors.groupingByConcurrent with Collectors.summarizingDouble to calculate numeric summary statistics separately for each group.

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

DoubleStream — filtering, counting, and averaging

DoubleStream processes primitive double values through a lazy pipeline. Learn stream creation, filtering, and the terminal operations count() and average().

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

IntStream — filtering and aggregating int values

IntStream processes primitive int values. It supports filtering data, testing conditions, and calculating element counts, sums, and averages.

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

LongStream — creating and summing a stream of long values

LongStream processes primitive long values rather than Long objects. LongStream.of creates a stream from supplied values, and LongStream.sum completes processing and returns their sum as a long.

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

Stream — element-processing pipelines

Stream<T> processes object references through a lazy pipeline. Learn stream creation, result arrays, primitive mappings, and encounter-order guarantees.

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

util.StringJoiner: practical reference

util.StringJoiner: practical reference: StringJoiner builds text from elements separated by a delimiter and optional prefix and suffix.

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

TreeMap — sorted maps and constructor references

TreeMap orders entries by key. Learn the difference between copying with TreeMap(Map), retaining a comparator with TreeMap(SortedMap), and using the constructor reference TreeMap::new.

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

util.TreeSet: practical reference

util.TreeSet: practical reference: TreeSet<E> is a TreeMap-backed NavigableSet sorted naturally or by a Comparator, with add, remove, and contains guaranteed O(log n).

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

util.UUID: practical reference

util.UUID: practical reference: UUID represents an immutable 128-bit value; the class methods manipulate the Leach-Salz variant layout, although its constructor can create any UUID variant.

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

WeakHashMap — a map with weak keys

WeakHashMap holds keys through weak references: the map alone does not protect them from garbage collection. Learn put, get, containsKey, containsValue, and size, including the distinction between a missing entry and a null value.

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