Declaring the array
The code in the doSomething function in Listing 1 begins by declaring a constant named size having a value of 5.
Then it uses that constant to declare an array named values having a size of five elements of type long .
(It is important to note that the value for size could have been derived from some other source before the array was declared.
For example, it could have been input by the user, or could have been the day of the month.
This makes it possible for the size of the array to be established when the program is run, as opposed to being established when the program is compiled.)