Why this code does'nt work?
package com.javarush.task.task08.task0816;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.*;
/*
Добрая Зинаида и летние каникулы
*/
public class Solution {
public static Map<String, Date> createMap() throws ParseException {
DateFormat dateFormat = new SimpleDateFormat("MMMMM d yyyy", Locale.ENGLISH);
Map<String, Date> map = new HashMap<>();
map.put("Смирнов", dateFormat.parse("MAY 1 2012"));
map.put("Смирнов1", dateFormat.parse("JUNE 1 2012"));
map.put("Смирнов2", dateFormat.parse("JULY 7 2012"));
map.put("Смирнов3", dateFormat.parse("AUGUST 2 2012"));
map.put("Смирнов4", dateFormat.parse("OCTOBER 3 2012"));
map.put("Смирнов5", dateFormat.parse("DECEMBER 12 2012"));
map.put("Смирнов6", dateFormat.parse("NOVEMBER 23 2012"));
map.put("Смирнов7", dateFormat.parse("JANUARY 7 2012"));
map.put("Смирнов8", dateFormat.parse("JUNE 5 2012"));
map.put("Смирнов9", dateFormat.parse("JULY 2 2012"));
return map;
//напишите тут ваш код
}
public static void removeAllSummerPeople(Map<String, Date> map) {
Iterator<Map.Entry<String, Date>> iterator = map.entrySet().iterator();//напишите тут ваш код
while (iterator.hasNext())
{
Map.Entry<String, Date> what = iterator.next();
if (what.getValue().getMonth() == 5 ||what.getValue().getMonth() == 6 || what.getValue().getMonth() == 7)
{
map.remove(what.getKey());
}
}
}
public static void main(String[] args) throws ParseException {
}
}