Correct me if I am wrong.
We can create arrays by doing
int[] arr= new int[2];
or
int[] arr={1,2,3};
There is no difference as far as initialization is concerned as long as we limit our thoughts to whether arr is a member or a local variable.
In both cases the arr is only a reference.
The actual array is created on the heap.
With local arr the reference arr is itself created on the stackframe.
If arr is assigned an array object the array elements may or may not have been explicitly initialised.
The arary elemets are not initialised in the case-int[] arr= new int[2];
If the array elements are not initialised they takeup default values.
These dfault values are 0 for primitive arrays and null for object ararys.
This behaviour of the array elemets is similar to that of object fields to some extent as far as the default values are concerened.
