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

util.function.BiPredicate: practical reference

util.function.BiPredicate: practical reference: BiPredicate<T,U> is a functional interface that tests a pair of arguments and returns a boolean.

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

Consumer<T> — an operation with no result value

Consumer<T> accepts one argument and returns no value. It represents actions with side effects; accept runs the operation, while andThen combines two operations that run in sequence.

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

Function — transforming values and composing functions

Function<T, R> describes an operation that accepts one argument and returns a result. Learn apply, the execution order of andThen and compose, and the identity function.

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

util.function.IntConsumer: practical reference

util.function.IntConsumer: practical reference: IntConsumer is the primitive specialization of Consumer for an int argument, with resultless accept(int) and no input boxing.

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

util.function.IntFunction: practical reference

util.function.IntFunction: practical reference: IntFunction<R> is a functional interface that maps a primitive int argument to a reference result R without boxing the input.

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

util.function.IntPredicate: practical reference

util.function.IntPredicate: practical reference: IntPredicate is the primitive specialization of Predicate for an int argument, returning boolean without input boxing.

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

Predicate — composing boolean conditions

Predicate<T> describes a condition on one argument of type T. It supports testing values and combining conditions using logical AND, OR, and negation.

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

util.function.Supplier: practical reference

util.function.Supplier: practical reference: Supplier<T> is a zero-argument functional interface whose get method supplies a result of type T.

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

util.function.UnaryOperator: practical reference

util.function.UnaryOperator: practical reference: UnaryOperator<T> specializes Function<T,T>: apply accepts a T and returns a result of the same type.

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

util.HashMap: practical reference

util.HashMap: practical reference: HashMap<K,V> is a hash-table Map implementation that permits one null key and null values without guaranteeing encounter order.

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

util.HashSet: practical reference

util.HashSet: practical reference: HashSet<E> is a HashMap-backed set that retains one element by equals and hashCode, permits null, and defines no encounter order.

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

IdentityHashMap — an object-identity map

IdentityHashMap compares keys using == rather than equals, so distinct objects with equal contents can be separate keys. Learn put, get, containsKey, and size, including how to distinguish a missing entry from a null value.

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

Iterator — traversing collection elements

Iterator reads collection elements sequentially and, when its optional remove operation is supported, can delete elements during traversal.

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

LinkedHashMap: entry order and an LRU cache

LinkedHashMap in java.util stores key–value mappings. The example demonstrates an LRU cache limited to two entries.

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

util.LinkedHashSet: practical reference

util.LinkedHashSet: practical reference: LinkedHashSet<E> combines HashSet with a doubly linked list, providing uniqueness and an encounter order normally matching insertion order.

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

util.LinkedList: practical reference

util.LinkedList: practical reference: LinkedList<E> is a doubly linked list implementing List, Deque, and in Java 21 SequencedCollection; it permits null elements.

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

java.util.List — an ordered collection of elements

List<E> describes an ordered collection with zero-based indexes, usually allowing duplicates. Learn how to read, add, and remove elements, and distinguish a modifiable list from an unmodifiable copy and a range view.

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

util.ListIterator: practical reference

util.ListIterator: practical reference: ListIterator<E> has a cursor between list elements and can traverse both directions while editing the current position safely.

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

Locale — language and region

Locale describes the language and regional context used by locale-sensitive operations.

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

java.util.Map — mapping keys to values

Map<K,V> associates each key with at most one value. Learn lookup, updates, computed values, and map views, with particular attention to null handling and implementation guarantees.

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

NavigableMap — neighboring keys and range views

NavigableMap extends SortedMap with neighboring-key lookups and range views whose boundary inclusion can be controlled.

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

NoSuchElementException — the requested element does not exist

NoSuchElementException is a java.util exception indicating that a requested element does not exist. For example, Iterator.next() throws it when the iterator has no remaining elements.

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

java.util.Objects — validation, equality, and hashing

Learn Objects.requireNonNull, Objects.equals, and Objects.hash: null checks, equality for nullable references, and computing a hash from fields.

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

Optional — a value or its absence

Optional<T> represents either a result containing a value or an empty result. Learn presence checks and safe access.

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