Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+22 votes
asked in CSC211_Winter2018 by (8 points)

4 Answers

+15 votes

Counting index starts from zero, so for the first letter "H" the index is 0, so in your case charAt(3) for the string is the second "I".

answered by (8 points)
+12 votes

String's characters start at 0.
0 = H
1 = e
2 = l
3 = l
4 = o
So , the answer to your questions is charAt(3) would be the second "l".

answered by (8 points)
+10 votes

The first character in each string starts at zero. So the third index would be the fourth character in that string. In this case the fourth character in "Hello" is "l".

answered by (8 points)
+10 votes

You start counting the index of a string from 0.
For example, for the string "Hello", H will be 0 and o will be 4.
So charAt(3) will be the second "l".

answered by (8 points)
...