Since day one of learning Java I\'ve been told by various websites and many teachers that arrays are consecutive memory locations which can store the specified number of data al
The reference of an array is not always on the stack. It could also be stored on the heap if it's a member of a class.
The array itself can hold either primitive values or references to an object. In any case, the data of an array are always of the same kind. Then the compiler can deal with their location without explicit pointers, only with the value/reference size and an index.
See:
* The Java Language Specification, Java SE 8 Edition - Arrays
* The Java Virtual Machine Specification, Java SE 8 Edition - Reference Types and Values