Arrays are ordered collections of values and can hold any number of items, for example, a list of Strings, Ints, floating-point values, and so on. Arrays are stored in an ordered list, starting at 0
. Let's look at a diagram:
Starting from left to right in the preceding examples, we first have an array that holds a collection of Strings. In the second example, we have another array that holds a collection of Ints. In our third example, we have an array that holds a collection of floating-point values.
Now, let's review the following diagram, which is a mixed array:
Since this example contains mixed data types, such as Strings, Ints, and bools, we would have to name this an array type of Any. This means that we can have mixed data types inside of our array. Until you are really comfortable with arrays, I would not recommend using them. Try to stick to arrays with the same data type because you know the exact data type of each element.
An array can hold any data type, but making the array...