展开全部
import java.uitl.*;
public class Demo{
public static void main(String[] args)throws Exception{
Map map = new HashMap();
String str="ADFGZXCVASDFCVDF";
for(int i = 0; i
Integer value = map.get(i);
if(value==null){
map.put(str.substring(i,(i+1)),1);
}else{
map.put(str.substring(i,(i+1)),++value);
}
}
Set set = map.entrySet();
for(Iterator it = set.iterator(); it.hasNext();){
Map.Entry entry = it.next();
System.out.print(entry.getKey()+"("+entry.getValue()+") ");
}
}
}
//代码我直62616964757a686964616fe59b9ee7ad9431333335333762接写的,没有运行,如有小错误请自行修改。