String test="abacedabcedbcdea"
find the frequency of a , b ,c ,e and d
4, 3, 3, 3 and 3
You just count the number of times each one appears in the String. A simple web search would tell you that.
I sure he knows that, he just wants a code handout. Which he won't get.
If he posts his attempt at it, he might get help correcting it, but noone is going to do it for him.
Try this simple example:
String s = "asjdhk123uhmsmik,z!?";
for (int i=0;i<s.length();i++) {
char ch = s.charAt(i);
System.out.println(ch);
}
Also you should always check the API to find more methods that could be useful. In this case, you should have looked the String API
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.