import java.util.HashMap;
import java.util.Map;
public class Test {
public static void main(String[] args) {
//计算单词个数
String[] arry = {"a", "c", "a", "b", "d", "c"};
Map map = new HashMap<>();
for (String s : arry) {
map.put(s, map.getOrDefault(s, 0) + 1);
}
map.forEach((key, value) -> System.out.println(key + " : " + value));
}
} 


