posted 8 years ago
You need to understand the difference between accessing the members of an array vs the total numbers of elements in an error.
Lets say you make an array of fingers. The length of this array would be 10 since we have ten fingers. However, when you want to access it one by one, you would have to go in the following manner:
0 1 2 3 4 5 6 7 8 9
Since it starts from 0, it ends at 9. So the 10th element in our array can be accessed as fingers[9] and not fingers[10]