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

Stream.map: practical reference

Stream.map: practical reference: map is a stateless one-to-one intermediate operation that lazily applies a Function to each consumed element and produces a stream of results.

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

Stream.mapMulti: practical reference

Stream.mapMulti: practical reference: mapMulti is a one-to-zero-or-many intermediate operation whose mapper sends each result to a supplied Consumer instead of creating a separate stream.

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

Stream.max: practical reference

Stream.max: practical reference: max is a terminal reduction that returns the greatest stream element under the supplied Comparator, or Optional.empty for an empty stream.

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

Stream.min: practical reference

Stream.min: practical reference: min is a terminal reduction that returns the least stream element under the supplied Comparator, or Optional.empty for an empty stream.

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

Stream.noneMatch: practical reference

Stream.noneMatch: practical reference: noneMatch is a short-circuiting terminal operation that returns true exactly when no stream element satisfies the supplied predicate.

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

Stream.peek: practical reference

Stream.peek: practical reference: Stream.peek(action) is a lazy intermediate operation that passes the same elements onward and invokes the Consumer as downstream traversal consumes them.

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

Stream.reduce: practical reference

Stream.reduce: practical reference: Stream.reduce performs a terminal associative reduction: an identity overload returns the identity for an empty stream, while the overload without it returns Optional.empty().

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

Stream.skip: practical reference

Stream.skip: practical reference: Stream.skip(n) is a lazy stateful intermediate operation that discards the first n elements in encounter order and exposes the remainder.

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

Stream.sorted: practical reference

Stream.sorted: practical reference: Stream.sorted is a stateful intermediate operation using natural order or a supplied Comparator; sorting is stable for an ordered stream.

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

Stream.takeWhile: practical reference

Stream.takeWhile: practical reference: Stream.takeWhile(predicate) is a short-circuiting stateful intermediate operation; for an ordered stream it returns the longest matching prefix from the start.

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

Stream.toList: practical reference

Stream.toList: practical reference: Stream.toList() is a terminal operation since Java 16 that accumulates elements in encounter order into an unmodifiable List.

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

StringBuilder.append — appending text

StringBuilder.append(String) adds text to the end of an existing builder and returns that same object, allowing calls to be chained.

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

StringBuilder.toString — obtaining text as a String

StringBuilder.toString() returns a String containing the builder's current contents. Later builder changes do not change the returned text.

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

String.charAt — reading a UTF-16 code unit

String.charAt(int index) returns the char at a zero-based index. It reads a UTF-16 code unit, not necessarily a complete Unicode character.

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

String.codePointAt — code point at a UTF-16 index

String.codePointAt returns an int representing a code point, but accepts a UTF-16 code-unit index, not a code-point ordinal.

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

String.compareTo — lexicographic comparison

String.compareTo compares strings lexicographically. The result's sign determines order; zero means equal contents.

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

String.concat(String)

In Java SE 21, `String.concat(String)` appends another string. If the argument is empty, it returns the original object.

Advanced · Java SE 21