Array, java Array
Baidu Encyclopedia:
An array is a set of elements of the same data type arranged in a certain order. It is to name a variable of the same type with a name, and then identify the set of their variables with a number, this name is called the array name and the number is called the subscript. Each variable that makes up an array is called the component of an array, also known as an element of an array, or a subscript variable. Arrays are a form of organizing several variables of the same type in order to facilitate processing in programming. The collections of these sort-by-order data elements are called arrays.
Format: data type array name [element];
Data Type array name [element] = {... initializing array list };
· And so on
Example:
Notes:
Int a [] = {1, 2, 3, 4, 5}; // The array with the initialization value list definition, without specifying the element size, the compiler calculates the number of elements in the initialization list to determine the number of elements in the array. Here, a [] is a [5] element.
Int a [5] = {1, 2, 3, 4, 5, 6}; // compilation error. Because there are 6 initialization values, a defines only five elements.