An array is a collection of elements stored in a two-part memory block, and each element in the array must be of the same data type, partitioned by an index, and the index of the first element in the array is 0.
Array length
The factor group is contiguous in the memory space, so the length of the array must be known when allocating space, and the length of the array cannot be changed.
Features of the array:
① Array is a contiguous memory space, subscript starting from 0;
② array elements are variables, and the variable type of the primary color is the type of the definition array;
③ array elements are initialized when they are created;
After the ④ array is created, the length cannot be changed.
Create an array
data type [] array variable name;
Or
Data type array variable name [];
Initialization of the array
There are generally two ways to initialize an array, one is to assign values directly when the array is created and initialized, such as: int[] array={,1,2,4,5,8,7,9,5,4,56};
Another way is to initialize the array first, and then assign values to the array by the subscript of the array.
An array of Java