array = new int[] {42};
This line creates a new integer array with size 1, whose only element is 42, and assigns it to array. It is equivalent to
array
array = new int[1]; array[0] = 42;
1.4m articles
1.4m replys
5 comments
57.0k users