As long as the number of array elements does not exceed the maximum number of elements that the array can accommodate, then all elements in the array are valid elements.
When defining an array, the number in square brackets after the array name represents the maximum element that the array can hold, here it is 10, and the number of elements in the following curly brackets is 7, which does not exceed the capacity of the array. The maximum number of elements that can be accommodated, so the effective number of array elements here is 7.
Another thing is that when referencing array elements, the number after the square brackets represents the position of the element in the array. However, you must remember that the subscript starts from zero when referencing. For example: If you want to find The third element "34" in the array should be a[2] instead of a[3]. I hope this can help you, thank you!