String str ="2342asfghgyu56asdasda";
Map<String,Integer> maps = new HashMap<String,Integer>();
for(int i=0;i<str.length();i++){
String key = String.valueOf((str.charAt(i)));
if(!maps.containsKey(key))
maps.put(key, 1);
else{
int val =maps.get(key);
maps.put(key, val+1);
}
}
for(Map.Entry i : maps.entrySet()){
System.out.println(i.getKey()+ "=="+i.getValue());
}