How can I find the number of occurrences of a character in a string?
For example: The quick brown fox jumped over the lazy dog.
Some example
Use google guava Multiset.
Multiset
Multiset wordsMultiset = HashMultiset.create(); wordsMultiset.addAll(words); for(Multiset.Entry entry:wordsMultiset.entrySet()){ System.out.println(entry.getElement()+" - "+entry.getCount()); }