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

IdentityHashMap: put, get, containsKey, and size

`IdentityHashMap` matches keys with `==`, not `equals`. Learn when `put` replaces an entry, what `size` counts, and how to tell a missing key from one mapped to `null`.

Advanced · Java SE 21
Java

InheritableThreadLocal — inheriting thread-local values

InheritableThreadLocal<T> passes an initial value from a parent thread to a newly created child thread. Inheritance occurs when the thread is created, not at start() or when a task is submitted to a pool.

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

Deprecated Integer(int) constructor

Each successful call to `Integer(int)` creates a distinct wrapper object. In new code, use `Integer.valueOf(int)` or autoboxing when you need a wrapper, not a fresh identity.

Advanced · Java SE 21
Java

Integer.max(): the larger of two int values

`Integer.max(a, b)` compares two signed `int` values and returns the larger one as an `int`. If both inputs are equal, it returns their common value.

Basic · Java SE 21
Java

Integer.parseInt — converting text to int

Integer.parseInt(String) converts a decimal integer representation to int. Invalid text or an out-of-range value causes NumberFormatException.

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

Integer.sum — adding two int values

`Integer.sum(a, b)` adds two `int` values just like `+`. Use `Integer::sum` when an API needs you to pass addition as a function.

Basic · Java SE 21
Java

Integer.toHexString — hexadecimal representation

Integer.toHexString represents an int as an unsigned hexadecimal String, using lowercase letters without unnecessary leading zeros.

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

Integer.valueOf: explicitly boxing an int

Turn a primitive `int` into an `Integer`, distinguish boxing from parsing text, and see why wrapper identity is not a reliable test of numeric equality.

Intermediate · Java SE 21
Java

IntStream.count — counting stream elements

IntStream.count() returns the number of elements as a long, not the sum of their values. It is a terminal operation that counts elements remaining after earlier operations such as filter.

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

Numeric operations on IntStream

Create and filter streams of primitive `int` values, then distinguish the result types and empty-stream behavior of counting, summing, and averaging.

Intermediate · Java SE 21
Java

InvocationTargetException — wrapping a failure in invoked code

InvocationTargetException wraps an exception thrown by a reflectively invoked method or constructor. Read getCause() to identify the original problem instead of diagnosing only the wrapper exception.

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

Iterable.forEach: an action for each element

Call `forEach` on an `Iterable` to run an action for each element. If the object specifies an iteration order, the method follows it unless the implementing class specifies otherwise.

Basic · Java SE 21
Java

io.BufferedReader: practical reference

io.BufferedReader: practical reference: BufferedReader buffers characters from a Reader and adds readLine; null means end of stream, while an empty line is returned as an empty string.

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