Array, which is a combination of multiple data types of the same type.
The use of arrays includes declaring arrays, creating arrays, assigning values.
Declaration of one-dimensional array, such as: float[] A; or float a[]
Declarations of two-dimensional arrays, such as: float[] [] A or float a[[]
The array declaration is not yet available, and it is created to assign an address entry to a.
One-dimensional array creation, such as A=new Float[4]
Two-dimensional array creation, such as A=new Float[3][4]
Of course, declarations and creation can be expressed in one sentence: float a[]=new float[4] float a[][]=new float[3][4]
Note: In particular, for multidimensional arrays, such as float a[][]=new float[3][] This sentence only creates one dimension, two dimensions have not yet been created, and add:
A[0]=new float[5];a[1]=new float[4];a[2]=new float[12];
After an array is created, the general environment assigns an initial value to the array variable, such as:
a[0]=12.3f;a[1]=34.23f;
More simply, we can implement the Declaration, creation, and assignment in just one sentence, such as:
Float a[]={21.23f, 34.12f, 56.37f}
float a[] []={{12.23f, 45.67f, 10.98f},{23.34f,22.22f}}
The above is a personal learning harvest, if there are errors, please correct me.
Using Java one-dimensional arrays and multidimensional arrays