結果 : occurrence of character in string in java using for loop