15.27 Constant Expression

ConstantExpression:
Expression

A compile-time constant expression is an expression denoting a value of primitive type or a String that is composed using only the following:

Compile-time constant expressions are used in case labels in switch statements (§14.9) and have a special significance for assignment conversion (§5.2).

Examples of constant expressions:

true
(short)(1*2*3*4*5*6)
Integer.MAX_VALUE / 2
2.0 * Math.PI
"The integer " + Long.MAX_VALUE + " is mighty big."

. . . when faces of the throng turned toward him and ambiguous eyes stared
into his, he assumed the most romantic of expressions . . .
--F. Scott Fitzgerald, This Side of Paradise (1920)