masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
You just count the number of times each one appears in the String. A simple web search would tell you that.
BestJewSinceJC
Posting Maven
2,772 posts since Sep 2008
Reputation Points: 874
Solved Threads: 354
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.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
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
javaAddict
Nearly a Senior Poster
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448