An array variable declaration, or a method returning an array type, may include bracket pairs either on the type or on the declarator, or in both locations:
int a[];
public int foo() [] { ... }
float[][] f[][], g[][][], h[]; // Yechh! (see JLS Example 10.2-2)
The preferred location of brackets for array types nowadays is on the type. Javac should issue a lint warning if brackets appear on a declarator.
int a[];
public int foo() [] { ... }
float[][] f[][], g[][][], h[]; // Yechh! (see JLS Example 10.2-2)
The preferred location of brackets for array types nowadays is on the type. Javac should issue a lint warning if brackets appear on a declarator.