What is an array?

An array is an ordered collection of values of the same type. The elements in the array are zero-indexed, which means the index of the first element is 0, the index of the second element is 1 and so on. Knowing this, you can work out that the last element’s index is the number of values in the array minus 1.

There are five elements in this array, at index values 0–4.

Also, all values are of type String. You can’t add non-string types to an array that holds strings. Notice that the same value can appear multiple times.

results matching ""

    No results matching ""