Trang is exactly correct. I'll add some detail.
The indexing of the characters in a String begins at 0. So the String "dog" has character 'd' at index 0, character 'o' at index 1, and character 'g' at index 2.
The length method of the String class returns the number of characters in a string. For the string "dog" the length method returns 3, but notice that no character in "dog" is at index 3.
When you try to use charAt(3) with "dog", then the error would be String index out of range since for "dog" the range of indices is from 0 through 2.
In the Practice It problem, one of the test strings has 7 characters with valid indices 0-6, so 7 sould be an index out of range.