Answer:
6
The first occurance of the string "a" within the method's string is at index 6.
Play with indexOf()
Play with the following to gain insight into indexOf().
|
Embedded Java applet removed: modern browsers do not support Java applets. The surrounding source code is retained for historical study.
|
Try searching for the second occurence of "ant" in the line. (Hint: pay attention to spaces.)
QUESTION 10:
What is the index of the empty string "" ?