官术网_书友最值得收藏!

Arrays

Arrays are ordered collections of values and can hold any number of items, for example, a list of strings, ints, and floating-point values. 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 mixed data 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 our array. Until you are genuinely comfortable with arrays, I would not recommend using mixed data arrays. Try to stick to arrays with the same data type because you will know the exact data type of each element.

An array can hold any data type, but making the array strongly typed means that every element in it must be of the same type.

主站蜘蛛池模板: 三原县| 密云县| 紫云| 卢湾区| 师宗县| 延安市| 尤溪县| 海盐县| 贵定县| 和林格尔县| 沙田区| 东乡县| 和政县| 象山县| 衡南县| 普定县| 堆龙德庆县| 宜丰县| 岐山县| 宁陕县| 山西省| 承德市| 隆子县| 米泉市| 墨脱县| 株洲县| 从江县| 乐陵市| 庐江县| 成安县| 亚东县| 太仓市| 股票| 张家口市| 汶川县| 崇义县| 铜鼓县| 墨江| 尤溪县| 屏东县| 洞头县|