I looked at some Java code today, and I found some weird syntax:
public class Sample { public int get()[] { return new int[]{1, 2, 3}; } }
As there is a C tag, I'll point out that a similar (but not identical) notation is possible in C and C++:
Here the function f returns a pointer to an array of 10 ints.
f
int tab[10]; int (*f())[10] { return &tab; }
Java simply doesn't need the star and parenthesis.