An array is a syntax used to store multiple data arrays of the same type. The array type [] array name = new array type [array length]; The array declaration has two forms: array type [] array name; array type array name []; Int [] is; int is []; array creation: // create an array with an integer of 5 int [] ins = newint [4]; floatflas [] = newfloat [10]; an array is used to store a group of data structures of the same data type. Array is also a reference type. The elements of an array can be simple data or reference data. The data stored in the array can be the class object, interface object, or array. The array declaration cannot specify the length of the array. Instead, you must specify the length of the array when creating the array. int [] is; int is2 []; String [] str; string strs []; String [] s = new String [3]; after this array is created, in the memory, the storage space stack is allocated to this array. The stack SS [0] = nullS [1] = nullS [2] = null array has two assignment values: static assignment: dynamic Value assignment: if an array of the reference type is created, the array object stack Stt St1 (address 1) St2 (address 2) is stored in the stack) stt [0] = st1Stt [1] = st2l Stt represents an array of Student classes, the array contains St1 and St2 // create a reference data type array (class, interface, array) // create an array of classes for Student [] sts = new Student [5]; Student st1 = new Student (); Stude Nt st2 = new Student (); Student [] stt = {st1, st2}; element reference in the array, the array index starts from 0 to the length of the array minus 1 Exception in thread "main" java. lang. arrayIndexOutOfBoundsException: 5 at com. softeem. array. array02.main (Array02.java: 21) is the traversal of an array with an array subscript out-of-bounds exception. // use the foreach statement to output the values in the array. // for (array-type custom name: array name) {} // The custom name here represents every element of the array for (String s: str) {System. out. println (s);} int [] iii = {12, 23, 34,456}; for (int u: iii) {System. out. println (u); Array Copy // copy an array // copy the values in one array to another. // 1: The two arrays must be of the same type. // 2: the destination array must be greater than or equal to the length of the original array, otherwise data will be lost // 3: If the destination array length is greater than the length of the original array, otherwise, use the default value of the array type to fill in // to copy the array. You must use the method String [] strs = {"light", "road ", "floor", "paper"}; String [] copystrs = new String [4]; // src-source array. // SrcPos-start position in the source array. // Dest-target array. // DestPos-start position in the target data. // Length-the number of array elements to be copied. System. arraycopy (strs, 0, copystrs, 0, 4); // output the value in the copystrs array for (String sss: copystrs) {System. out. println (sss);} multi-dimensional array int [] [] a = {1, 2}, {10, 2 }, {20,1 }}// multi-dimensional array String [] [] hh = null; String gg [] [] = {"1", "2", "3 "}, {"4", "5", "6" },{ "a", "B" }}; for (String [] f: gg) {for (String ss: f) {System. out. println (ss );}