字符串中出现次数最多的字符
public class Test3 {
public static void main(String[] args) {
String s = "aabasfdffffffffssf";
int count = 0;
String str = "";
String res = "";
int length = s.length();
while(s.length() > 0) {
str = String.valueOf(s.charAt(0));
s = s.replace(str, "");
if (count < length - s.length()) {
count = length - s.length();
res = str;
}
length = length - count;
}
System.out.println(res);
}
}