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

String.format — formatting text

String.format builds text from a format string and arguments using specifiers such as %s, %d, and %.2f. An explicit Locale makes numeric formatting independent of the environment's default locale settings.

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

String.hashCode — a string's hash code

String.hashCode returns an int hash code calculated from a string's contents. Equal strings have equal hashes, but matching hashes do not prove that strings are equal.

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

String.indexOf — finding a substring

String.indexOf returns the position of the first substring match or -1. The fromIndex parameter lets you start searching at a specified position.

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

String.isBlank — checking empty or whitespace-only text

String.isBlank checks whether a string is empty or contains only whitespace as defined by Character.isWhitespace(int). It returns boolean and has been available since Java 11.

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

String.isEmpty — checking for an empty string

String.isEmpty() checks whether a string has length zero. It does not treat spaces as empty text and requires a non-null reference; use isBlank() to check for empty text or text consisting only of whitespace.

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

String.join — joining text with a delimiter

String.join builds text from elements separated by a delimiter. It accepts an Iterable or varargs arguments.

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

String.length — length in UTF-16 units

String.length() returns the number of UTF-16 code units, not necessarily the number of user-visible characters.

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

String.matches: match an entire string against a regex

Test whether an entire string matches a regular expression. Learn how `(?s)` changes the dot, which character classes default to ASCII, and how to write regex backslashes in Java string literals.

Intermediate · Java SE 21
Java

String.replace — literal text replacement

String.replace replaces all literal matches without regular expressions. It returns the result without changing the original.

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

`String.replaceAll()`: regex replacement

Replace every match of a regular expression. The example masks values in one specific password-argument format without changing the inputs.

Advanced · Java SE 21
Java

String.split — splitting text with a regular expression

String.split returns an array of text fragments separated by regular-expression matches. The limit parameter controls the number of splits and the treatment of trailing empty elements.

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

String.startsWith — checking a prefix

String.startsWith checks whether a string begins with a given prefix, optionally at a specified index.

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

String.substring — extracting part of a string

String.substring returns part of a string without changing the original. The start is inclusive and the end exclusive; indices count UTF-16 code units.

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

String.toLowerCase — converting to lowercase

String.toLowerCase returns lowercase text. The choice of Locale affects the result; use Locale.ROOT for language-independent text.

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

String.toUpperCase — converting to uppercase

String.toUpperCase returns uppercase text. The chosen Locale affects the result; Locale.ROOT provides language-neutral rules.

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

SynchronousQueue — handoff without a buffer

SynchronousQueue transfers an element directly between threads. Its put and take operations wait for a matching partner rather than using a buffer.

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

System.arraycopy — copying an array range

System.arraycopy copies elements into an existing array, supporting overlapping ranges while requiring compatible types and valid bounds.

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

System.identityHashCode — an object's identity hash code

System.identityHashCode returns an object's identity-based hash code, bypassing an overridden hashCode() method. It returns 0 for null. The result is not a unique identifier and does not replace reference comparison with ==.

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

System.lineSeparator() — system-dependent line separator

System.lineSeparator() returns the system-dependent line separator. Use it when building text with native line endings, but not instead of a separator required by a data format.

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