Which of the for loops below will traverse the whole string fruit?
for(int i = 0; i < fruit.length(); i++)
- for(int i = 0; i <= fruit.length(); i++)
- for(int i = 0; i < fruit.length(); i += 2)
- for(int i = 0; i < fruit.length() - 1; i++)
Remember indexes in a string start at 0 and go to one less than the length