Pergunta de entrevista da empresa WebMD Health

Count occurrences of character in a given string in java