int []a;
a = new int[3];
a[0] = 10;
a[1] = 20;
a[2] = 30;

All the above statements we can replace with a single line as follows.

int[] a = {10,20,30};

If we want to use the above shortcut technique compulsory we should perform declaration,construction initialization in a single line only. If we are dividing into 2 lines we will get compile time error.

int[] a;
a = {10,20,30,40};
C.E: illegal start of expression.


int[][] a = {{10,20},{30,40,50}};
int[][][] a = {{{10,20},{30,40}},{{50,60},{70,80}}};