Your code:
int arr1[4] = new int[];
will not compile. It should be:
int arr1[] = new int[4];
putting [] before the array name is considered good practice, so you should do:
int[] arr1 = new int[4];
in general an array is created as:
type[] arrayName = new type[size];
The [size] part above specifies the size of the array to be allocated.
And why do we use new while creating an array?
Because arrays in Java are objects. The name of the array arrayName in above example is not the actual array, but just a reference. The new operator creates the array on the heap and returns the reference to the newly created array object which is then assigned to arrayName.