I remember there are three ways to define the array today, but I forgot to forget it,,,
Then look at the book, look it up online, sort out three ways
Method 1 (recommended, more indicative of array type) type[] Variable name = number of elements in the new type[array]; For example: int[] A = new int[10]; The array name, which refers to a, points to the first address of the array element. Mode 2 (same as C language) type variable name [] = number of elements in the new type[array]; such as: int a[] = new INT[10]; Mode 3 defines the direct initialization of the type[] variable name = new type[]{comma-separated initialization value}; But it can be written as follows, there are two kinds: int[] a = {1,2,3,4}; Int[] A = new int[]{1,2,3,4}; where int[] a = new int[]{1,2,3,4}, the second square bracket cannot be added to the array length, because the number of elements is determined by the contents of the following curly braces.
Java Learning Note 5