Originally Posted by xwid
Sorry, but I don't think that makes it clear. Where does it say that a String is an array of chars? A String is a string of chars, but where does it define the implementation of String to be that of an array?
The last character is not at index four because
five minus one is four. It's there because the first character is at index zero, so the second character is at index one, so the third character is at index two, so the fourth character is at index three, so the fifth character is at index four.
My point is that the "0 index" idea is not specific to arrays. See also: Zero-based numbering - Wikipedia, the free encyclopedia