9.3. Field (Constant) Declarations
ConstantDeclaration: ConstantModifiersopt Type VariableDeclarators ;
ConstantModifiers: ConstantModifier ConstantModifier ConstantModifersConstantModifier: one of Annotation public static final
If an annotation a (§9.7) on a field declaration corresponds to an annotation type T (§9.6), and T has a (meta-)annotation m that corresponds to java.lang.annotation.Target
, then m must have an element whose value is java.lang.annotation.ElementType.FIELD
, or a compile-time error occurs.
Every field declaration in the body of an interface is implicitly public
, static
, and final
. It is permitted to redundantly specify any or all of these modifiers for such fields.
If two or more (distinct) field modifiers appear ...
Get The Java® Language Specification, Java SE 7 Edition, Fourth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.