private static void countString(String str){
HashMap<Character,Integer> map=new HashMap<>();
char[] chars = str.toCharArray();
for (char c : chars) {
if (map.containsKey(c)){
Integer value = map.get(c);
value++;
map.put(c,value);
}else {
map.put(c,1);
}
}
for (Character key : map.keySet()) {
Integer value = map.get(key);
System.out.println(key+":"+value);
}
}