I was updating a legacy code base in Java and I found a line like this:
Object arg[] = { new Integer(20), new Integer(22) };
That line catc
Both are legal and both work. But placing [] before the array's name is recommended.
From Javadocs:
You can also place the square brackets after the array's name:
float anArrayOfFloats[]; // this form is discouraged
However, convention discourages this form; the brackets identify the array type and should appear with the type designation.