Here is the grammar for array creation in Java:
ArrayCreationExpression:
new PrimitiveType DimExprs [Dims]
new ClassOrInterfaceType DimExprs [Dims]
new PrimitiveType Dims ArrayInitializer
new ClassOrInterfaceType Dims ArrayInitializer
DimExprs:
DimExpr {DimExpr}
DimExpr:
{Annotation} [ Expression ]
Dims:
{Annotation} [ ] {{Annotation} [ ]}
Why here: new PrimitiveType DimExprs [Dims] Dims is in brackets? If it is in brackets then I can write this: new int [2][2] [[] []] where [2][2] is the DimExprs part and [] [] is the Dims part. What am I doing wrong here?