I am doing some studying and I came across a question that asks to show the correct memory diagram of the following code:
int [] d1 = new int[5];
d1[0] = 3;
Arrays are not primitive in java it has concrete class in java.
An array is a container object that holds a fixed number of values of a single type. The length of an array is established when the array is created.
System.out.print(int[].class.toString());
So when you create Object of any array type it must go to you heap space.