I have a program like this
public class no_of_letters_count {
static int i;
public static void main(String[] args)
{
String sMessage="hello how r u";
String saMessage[] = sMessage.split("");
List sList = Arrays.asList(saMessage);
Collections.sort(sList);
Iterator i=sList.iterator();
while (i.hasNext())
{
System.out.println((String)i.next());
}
}
}
//Now i want to count the number of occurance of each characters.
Like
Count of h=2
Count of e=1
and so on