vaibhavi nair wrote:this program is to show the repetition of characters in a word. but whenever i put "java" or "sangeeta" as the input, the screen doesn't show "do you want to continue:Y/N" statement,or i would say the statement out of the for loop is not running. I am not getting what is the problem. if i put any other name which does not have a in between. The "do you want to continue:Y/N" statement shows up. please help.
First, please
UseCodeTags (←click).
Second, it's not clear from your explanation (or your code) exactly what you want the program to output.
Third, a couple of tips for you:
1.
br.readLine().trim() will return an already trimmed line.
2. You might be better off using a structure like a Map to hold your counts. If I were doing it, I'd probably use a
HashMap<Character, AtomicInteger>. I'll leave you to work out why.
Winston