public static void removeAllSummerPeople(HashMap<String, Date> map) { HashMap<String, Date> copy = new HashMap<>(map); for (String key : copy.keySet()) { Date date = copy.get(key); int month = date.getMonth() + 1; if (month == 6 || month == 7 || month == 8) { map.remove(key); } } } int month = date.getMonth() + 1; 这里 获取月份 为什么要 加1 啊