An array is a data structure used for storing a collection of values.
To declare an array, a set of square brackets is appended to the data type the array will contain, followed by the array’s name. Alternatively, the brackets may be placed after the array name. Arrays can be declared with any data type and all of its elements must then be of that type.
int x;int y;
The array is allocated with the new keyword, followed again by the data type and a set of square brackets containing the length of the array. This is the fixed number of elements that the array can contain. Once the array is ...