Array definition: An array is a collection of data of the same type, which describes a combination of several data of the same type, each of which is called an array element, and each array element can be
A subscript to access them.
Four basic points of the array:
1, fixed length, once created its length is immutable
2, its element type must be the same type, no blending type is allowed
3, the element in the array is any data type, including the base data type and the reference data type
4, array variables are reference types, arrays can also be considered as objects, each element of the array is equivalent to the object's member variable, the array itself is an object, the object in Java is in the heap
So the array itself is in the heap, regardless of whether it holds the original type or other object types.
The subscript legal interval for an array is [0,arr,length-1]
Copy of array: system,arraycopy (source array, starting from where, target array, starting from, sticking a few)
Ordering of arrays: Arrays.sort (sorted array)
Binary lookup: Arrays.binarysearch (that array, what elements in the array)
Padding array: Arrays.fill (a,2,4,10). Replace the element with index 2 through 4 in array a with 10
Get array Length: array. length. A[0].length in a two-dimensional array represents the length of the first array in a two-dimensional array
Array traversal: You can use a for loop or for nested loops (two-dimensional arrays)
An overview of java-arrays