Post History
Abuse the C-like array syntax If you ever have to declare two variables, one of type X and the other of type X[], instead of two statements, you can declare them together using this atrocious synt...
#1: Initial revision
# Abuse the C-like array syntax
If you ever have to declare two variables, one of type `X` and the other of type `X[]`, instead of two statements, you can declare them together using this atrocious syntax:
```java
int i,a[],m[][];
```
This defines an `int i`, an `int[] a`, and an `int[][] m`.
## Fun fact
This also works with method return types, and can actually be useful if you want to apply annotations to the type an array holds, e.g.
```java
public @NotNull String foo() @Nullable [] {}
```
