> Online tutorial : field declarations java
Showing posts with label field declarations java. Show all posts
Showing posts with label field declarations java. Show all posts

field declarations java


Field Declarations
Poetic fields encompass me around,And still I seem to tread on classic ground.
The variables of a class type are introduced by field declarations:
FieldDeclaration:

FieldModifiersopt Type VariableDeclarators ;
VariableDeclarators:
VariableDeclarator
VariableDeclarators , VariableDeclarator
VariableDeclarator:
VariableDeclaratorId
VariableDeclaratorId = VariableInitializer
VariableDeclaratorId:
Identifier
VariableDeclaratorId [ ]
VariableInitializer:
Expression
ArrayInitializer
  • The FieldModifier are described in The Identifier in a FieldDeclarator
    may be used in a name to refer to the field.
    Fields are members;
  • the scope of a field declaration is specified in More than one field may be declared in a single field declaration by using more than one declarator;
  • the FieldModifiersand Type apply to all the declarators in the declaration.
  • Variable declarations
    involving array types are discussed in
    It is a compile-time error for the body of a class declaration to declare two
    fields with the same name.