Below are examples of creating arrays in code:
First example:
The first array, called test1, is an integer array composed of 5 elements. We initialize all 5 elements afterwards.
Second example:
The second array contains 4 elements. However, notice that we only initialize 2 values,
When initializing values of an array, you don't have to initialize all of the values of the array.
The rest of the items will be automatically initialized to 0.
So, in this example, element 0 of the array is 35 and element 1 is 25, while the rest of the items are 0.
Third example:
The third array is of type double, There are 30 elements in the array and each item is initialized to 0.
So each item has a value of 0 for all 30 elements.
Fourth example:
In the last array example, the number of elements in the array was not declared
this is actually ok. Once you initialize the values of the array,
the compiler will count the number of items initialized and this will be the size of the array.