結果 : count occurrences of character in string java without using hashmap