public class MyWord {
final static String[] MY_WORD = { "It's could only be Heineken","Hello,I have to go to somewhere","Someday, I will find my way","Life is not beautiful" };
public static void main(String args[]){
int count,pos;
String[] str = MyWord.MY_WORD;
for(int i=0;i<str.length;i++) {
count = 0;
System.out.println("Find 'e' in this sentence "+str[i]);
System.out.print("Found 'e' at index :");
for(int j=0;j<str[i].length();j++) {
if (str[i].charAt(j)=='e') {
count++;
System.out.print(" "+j);
}
}
System.out.println("\nTotal 'e' : "+count);
System.out.println("**********************************");
}
}
}