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

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.

主站蜘蛛池模板: 武功县| 樟树市| 周口市| 漳州市| 长乐市| 进贤县| 海安县| 托里县| 佛冈县| 邯郸市| 嘉黎县| 东丽区| 南通市| 沅陵县| 泉州市| 湟中县| 天水市| 类乌齐县| 龙江县| 高碑店市| 米林县| 文化| 金塔县| 博兴县| 常德市| 新丰县| 海口市| 临沂市| 鹿邑县| 丘北县| 且末县| 都江堰市| 通海县| 霍邱县| 吐鲁番市| 安庆市| 永宁县| 浠水县| 雅江县| 射阳县| 蒲城县|