private String[][] var[]
This code compiles. But shouldn\'t they make the array on type or variable?
This is an example that shows you when the []
position makes a difference.
String[] arr, arr2[];
The arr
is an array of String
whereas the arr2
is an array of arrays of String
.
It can as you see be beneficial if you want to declare different arrays on the same line.
And in your example it could have been another var2
declared on the same line:
private String[][] var[], var2;