int[] arr = new int[10]; //this is correct way of declaring and initializing an array in java.
There are many ways to create and initialize an array in java:
How to declare an array:
1. int[] arr; this declaration says, arr is an array of integers. Note: don't give size in declaration, it is a compile time error.
arr = new int[10]; this memory allocation(creation) for the above array.
2. int[] arr = new int[10]; This is both declaration and creation of an array. New operator creates an array of 10 ints in heap.
3. int[] arr = {1,2,3}; This is both declaration, creation, and initialization. it creates a new array of 3 elements in heap and assigns values to it.
4. int[] arr = new int[]{1,2,3}; This is also one more way of declaring, allocating, and initializing arrays.