J.VI · Java 25 practice question

In `public static <T> ScopedValue<T> newInstance()`, what does the type parameter `T` specify?

Choose one answer
Check answer and explanation

Correct answer: The type of the value held by the `ScopedValue`.

Explanation

In `ScopedValue.newInstance()`, the type parameter `T` specifies the type of the value stored in the `ScopedValue`.

Common trap

`T` does not restrict thread subclasses or represent a timeout duration.

Source: Java SE 25 API: ScopedValue.newInstance
Checked against the cited text on 2026-11-27.

Report an error in this question