9.3 Field (Constant) Declarations

The materials of action are variable,
but the use we make of them should be constant.

—Epictetus (circa 60 A.D.), translated by Thomas Wentworth Higginson

ConstantDeclaration:
ConstantModifiers Type VariableDeclarator
ConstantModifiers: one of
public static final

Every field declaration in the body of an interface is implicitly public, static, and final. It is permitted, but strongly discouraged as a matter of style, to redundantly specify any or all of these modifiers for such fields.

A constant declaration in an interface must not include any of the modifiers synchronized, transient, or volatile, or a compile-time error occurs.

It is possible for an interface to inherit more than one field with the same name (§8.3.3.3). Such a situation does not in itself cause a compile-time error. However, any attempt within the body of the interface to refer to either field by its simple name will result in a compile-time error, because such a reference is ambiguous.

There might be several paths by which the same field declaration might be inherited from an interface. In such a situation, the field is considered to be inherited only once, and it may be referred to by its simple name without ambiguity.