51,409
社区成员
发帖
与我相关
我的任务
分享
char[] ch = test.toCharArray();
Map<character,Integer> map = new HashMap<character,Integer>();
for(char c : ch){
if(map.constainKey(c)){
map.put(c,map.get(c)+1);
}else{
map.put(c,1);
}
}
system.out.println(map);