What is a class constant?

JLS-8.3.1.1. static Fields says (in part)

static field, sometimes called a class variable, is incarnated when the class is initialized (§12.4).

JLS-4.12.4. final Variables says (in part)

constant variable is a final variable of primitive type or type String that is initialized with a constant expression (§15.28)

tl;dr

Putting that together, a class constant is a static final field.

Leave a Comment