14.3.1
Local Variable Declarators and Types
BLOCKS AND STATEMENTS
The following are repeated from 8.3 to make the presentation here clearer:
VariableDeclarators:
VariableDeclarator
VariableDeclarators
,
VariableDeclarator
VariableDeclarator:
VariableDeclaratorId
VariableDeclaratorId
=
VariableInitializer
VariableDeclaratorId:
Identifier
VariableDeclaratorId
[ ]
VariableInitializer:
Expression
ArrayInitializer
Every local variable declaration statement is immediately contained by a
block. Local variable declaration statements may be intermixed freely with other
kinds of statements in the block.
A local variable declaration can also appear in the header of a
for
statement
( 14.12). In this case it is executed in the same manner as if it were part of a local
variable declaration statement.
14.3.1 Local Variable Declarators and Types
Each
declarator
in a local variable declaration declares one local variable, whose
name is the
Identifier
that appears in the declarator.
The type of the variable is denoted by the
Type
that appears at the start of the
local variable declaration, followed by any bracket pairs that follow the
Identifier
in the declarator. Thus, the local variable declaration:
int a, b[], c[][];
is equivalent to the series of declarations:
int a;
int[] b;
int[][] c;
Brackets are allowed in declarators as a nod to the tradition of C and C++. The
general rule, however, also means that the local variable declaration:
float[][] f[][], g[][][], h[];
//
Yechh!
is equivalent to the series of declarations:
266
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved