List list = Arrays.asList("aa,xx,ss,xx,ss,e,w,a,aa".split(","));
Map map = new HashMap();
for (String s : list) {
Integer i = map.get(s);
if(i == null)
map.put(s, 1);
else
map.put(s, ++i);
}
System.out.println(map);
原文:https://www.cnblogs.com/magichu/p/14769531.html