The grammar for method declarations in Java is something like the following:
method_declaration
::=
{ modifier } type identifier
"(" [ parameter_list ] ")" { "[" "]" }
( statement_block | ";" )
And I am wondering what do the square brackets mean.
The square brackets are to indicate the method returns an array. For example, you can write a method that returns an array of int as:
int method()[] { … }
Many people aren't familiar with this syntax though, and it's best avoided.
You'll find the complete syntax for java 7 here: http://docs.oracle.com/javase/specs/jls/se7/html/jls-18.html