What will be the output of the following program?
public class Squirrels {
public static void main(String[] args) {
String sounds[] = {"chittering", "chirping", "barking", "squealing"};
int i = 0;
int startIndex = 0;
int endIndex = sounds[i].indexOf('t');
do {
int length = sounds[i].length();
if (startIndex >= 0 && endIndex < length)
System.out.print(sounds[i].substring(startIndex, endIndex + 1) + "#");
else if (endIndex >= length)
System.out.print(sounds[i].substring(startIndex, 3) + "$");
endIndex = sounds[i].indexOf('i');
i++;
} while (i < sounds.length);
}
}