1. Definition of array
Used to store a collection of data of the same type, in fact an array is a container.
Contiguous storage Unit 2. Benefits of Arrays
Automatically numbers the elements in an array from zero. Automatically give subscript, starting from zero 0-1-2-3-...... 3. Writing format
element type [] Array name = new element type []{element, element, element ...};
Format 1:int [] arr = new INT[5];
Need to manually assign value arr[0]=1;
arr[1]=2;
Arr[3]=3
arr[4]=4;
arr[5]=5;
Format 2:int [] arr = new int[]{1,3,5,7}
Format 3:int[]arr = {1,3,5,7};
4. The memory structure of the array
5. Memory characteristics of the array
(1). Because the use of the keyword new will open up the corresponding space in the heap memory, each given a different address of two arrays. When compared, the address of the two array is compared to a different
(2). This example does not use the New keyword, but the same comparison is also the address of the array;
(3). This example output is true