I think that it wasn't possible in the previous versions of java. The next code compiles fine with jdk1.5.0:
public class Test {
public static void main(String[] args) {
int[] arr1 = {1, 2, 3,}; // <- last comma
String[] arr2;
arr2 = new String[]{"a", "b", "c",}; // <- last comma
float[] arr3 = {,}; // <- last comma
}
}
Is it a bug or a feature?