Aristocrat interview question

Java program to find occurrences of each character in string