1public static void main(String[] args) {
2 int wordCount = 0;
3 String word = "hill";
4 for (char letter = 'a'; letter <= 'z'; letter++) {
5 for (int i = 0; i < word.length(); i++) {
6 if (word.charAt(i) == letter) {
7 wordCount++;
8 }
9 }
10 if (wordCount > 0) {
11 System.out.println(letter + "=" + wordCount);
12 wordCount = 0;
13 }
14 }
15 }