An array is a data structure that can hold multiple values of the same type in a single variable. Arrays are used to store a collection of data that can be accessed by index.
0
. So, numbers[0]
refers to the first element.
1. What is the index of the first element in an array?
2. How do you access the third element of an array called arr
?
3. What does this code do?
4. How would you declare an array of strings in C#?
5. Which property gets the length of an array?
0
in C#. The last index is Length - 1
.