The array elements of an array can be initialized, with values of your choice, at the time the array is being created. To accomplish this, you first need to write the declaration of the array variable as usual. However, instead of creating the array object using the new keyword, as in the following
new int ;
you can specify the list of initialization values explicitly by enclosing them in braces, and assigning this list to the array variable with the assignment operator. The following line follows this procedure:
The array object is automatically created with just enough array elements (six, in this example) to hold the ...