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.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
Java

util.OptionalDouble: practical reference

util.OptionalDouble: practical reference: OptionalDouble is a value-based container for one primitive double or absence, without boxing to Double.

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

util.OptionalInt: practical reference

util.OptionalInt: practical reference: OptionalInt represents one present primitive int or absence and avoids creating an Integer object.

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

util.OptionalLong: practical reference

util.OptionalLong: practical reference: OptionalLong stores one present primitive long or an empty state without boxing to Long.

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

util.PriorityQueue: practical reference

util.PriorityQueue: practical reference: PriorityQueue<E> is an unbounded heap queue whose head is the least element under natural ordering or the supplied Comparator.

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

Queue — inserting, inspecting, and retrieving elements

The java.util.Queue interface describes a queue of elements awaiting processing. Learn how offer differs from add and poll differs from remove, how peek inspects the head, and how isEmpty checks whether the queue contains elements.

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