Не знааааююююююююю............
package com.javarush.task.task08.task0816;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
public class Solution {
public static HashMap<String, Date> createMap() throws ParseException {
DateFormat df = new SimpleDateFormat("MMMMM d yyyy", Locale.ENGLISH);
HashMap<String, Date> map = new HashMap<String, Date>();
map.put("Stallone", df.parse("JUNE 1 1980"));
map.put("Stallone1", df.parse("JULY 1 1980"));
map.put("Stallone2", df.parse("SEPTEMBER 1 1980"));
map.put("Stallone3", df.parse("AUGUST 1 1980"));
map.put("Stallone4", df.parse("JANUARY 1 1980"));
map.put("Stallone5", df.parse("APRIL 1 1980"));
map.put("Stallone6", df.parse("OCTOBER 1 1980"));
map.put("Stallone7", df.parse("JUNE 1 1980"));
map.put("Stallone8", df.parse("NOVEMBER 1 1980"));
map.put("Stallone9", df.parse("FEBRUARY 1 1980"));
return map;
//напишите тут ваш код
}
public static void removeAllSummerPeople(HashMap<String, Date> map) {
Iterator<Map.Entry<String, Date>> iterator=map.entrySet().iterator();
while (iterator.hasNext()){
Map.Entry<String, Date> pair=iterator.next();
Date date=pair.getValue();
int mnth=date.getMonth();
if ((mnth<9)&&(mnth>5)){
iterator.remove();
}
}
}
public static void main(String[] args) throws ParseException {
removeAllSummerPeople(createMap());
}
}