Consider the example:
enum SomeEnum {
VALUE1(\"value1\"),
VALUE2(\"value2\"),
VALUE3(\"value3\")
;
private String value;
private SomeEnu
The enums itself (VALUE1
, VALUE2
and VALUE3
) are static and final. They are three instances of the SomeEnum
type and we can't change them (like deleting VALUE1
from the enum or adding a VALUE4
at runtime).
But we can add public fields to the instances (like in your example) and alter the content of those fields at runtime.