J.III · Java 25 practice question
According to the JLS SE 25 grammar for TypeParameter, which modifier is permitted directly on a type parameter declaration?
Check answer and explanation
Correct answer: An annotation
Explanation
In the grammar for TypeParameter, TypeParameterModifier is defined exclusively as Annotation.
Common trap
The final keyword applies to classes, methods, or variables, not to type parameters. The static keyword applies to nested types or members, not to individual type parameter declarations.
Source: JLS SE 25 §8.1.2. Generic Classes and Type Parameters
Checked against the cited text on 2026-11-25.