Knowing how many repeat the letters in the String : <p>i have an interview Question which is 
Knowing repeat the letters in the String 
i solve it like this </p>

<pre><code>String str = "my name is Java Developer";
    int count = 0;
    for (int i = 0; i &lt; str.length(); i++) {
        for (int j = 0; j &lt; str.length(); j++) {
            if (str.charAt(i) == str.charAt(j)) {
                count = count + 1;
            }

        }
        System.out.print(count + "  ");
        count = 0;
    }
</code></pre>

<p>but 
my problem was 
1 - avoid the space from count
2-there is repeated character counted like m in 'my' and m in 'name'
i don't want to repeat the count for the characters
3- i want to solve it in another way plus this one </p>

<p>thank you ,,</p>
