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

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
Java

String.contains — checking for a substring

String.contains checks whether text contains a given sequence of char values. It returns boolean, is case-sensitive, and does not interpret regular expressions.

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

The String(String) copy constructor

The `String(String)` constructor creates a distinct object with the same text. Use `==` to compare references and `equals` to compare string contents.

Advanced · Java SE 21
Java

String.equals — comparing string contents

String.equals compares string contents with case sensitivity. The == operator compares object identity rather than contents.

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