J.I · Java 25 practice question
In a numeric context where none of the expressions have type double, float, or long, what determines how the promoted type is chosen?
Check answer and explanation
Correct answer: The kind of numeric context
Explanation
When none of the expressions are double, float, or long, the kind of context itself determines how the promoted type is chosen.
Common trap
Numeric promotion is a compile-time rule and never depends on runtime operand values. Operand order does not dictate the promoted type in Java numeric contexts.
Source: JLS SE 25 §5.6. Numeric Contexts
Checked against the cited text on 2026-11-25.