J.III · Java 25 practice question

A developer inspects a parameterized type written as Box<String>. According to JLS SE 25, what is Box in this expression?

Choose one answer
Check answer and explanation

Correct answer: The name of a generic class or interface

Explanation

In a parameterized type of the form C<T1,...,Tn>, C names the generic class or interface being parameterized.

Common trap

Treating C as a type variable confuses the generic type name with a declared type parameter identifier. Calling C an additional bound confuses type arguments with TypeBound syntax. Calling C an additional bound confuses type arguments with TypeBound syntax.

Source: JLS SE 25 §4.5. Parameterized Types
Checked against the cited text on 2026-11-25.

Report an error in this question