import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeMap;
public class MapTest3 {
public static void main(String[] args) {
String s = "sdfgzxcvasdfxcvdf";
char[] ch = s.toCharArray();
TreeMap
for (int i = 0; i < ch.length; i++) {
int count = 0;
char c = ch[i];
tm.put(c, 1);
for (int j = i + 1; j < ch.length; j++) {
if (ch[j] == ch[i]) {
count++;
}
}
Integer pre_count = tm.get(ch[i]);
if (count > pre_count) {
tm.put(c, count);
}
}
System.out.println(tm);
}
}