This was asked by a friend. Strangely enough this java code compiles and runs properly.
int getArray() [] { ... }
Am I missing something here. Shouldn’t it be
int[] getArray() { ... }
EDIT:
getArray() is a function here which returns an integer array.
From section 8.4 of the JLS:
While I occasionally see a variable declaration with the array specifier after the name (ick) I’ve never seen it used for a method declaration like this. Weird.