The Java® Language Specification, Java SE 7 Edition, Fourth Edition
by James Gosling, Bill Joy, Guy Steele, Gilad Bracha, Alex Buckley
8.3. Field Declarations
The variables of a class type are introduced by field declarations.
FieldDeclaration: FieldModifiersopt Type VariableDeclarators ;VariableDeclarators: VariableDeclarator VariableDeclarators , VariableDeclaratorVariableDeclarator: VariableDeclaratorId VariableDeclaratorId = VariableInitializerVariableDeclaratorId: Identifier VariableDeclaratorId [ ]VariableInitializer: Expression ArrayInitializer
The FieldModifiers are described in §8.3.1.
The Identifier in a FieldDeclarator may be used in a name to refer to the field.
More than one field may be declared in a single field declaration by using more than one declarator; the FieldModifiers and Type apply to all the declarators in the declaration. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access