hi need help is my format/conditions incorrect please help me.. what are the other ways i could the find the date in between month
package com.codegym.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;
/*
Kind Emma and the summer holidays
*/
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("Red", df.parse("JULY 3 2010"));
map.put("FDAF", df.parse("AUGUST 4 2014"));
map.put("GESA", df.parse("SEPTEMBER 5 2000"));
map.put("GDSA", df.parse("OCTOBER 20 2001"));
map.put("HHK", df.parse("NOVEMBER 16 2002"));
map.put("YTU", df.parse("DECEMBER 14 2004"));
map.put("YTIYT", df.parse("JANUARY 13 2003"));
map.put("POHG", df.parse("FEBRUARY 10 2007"));
map.put("RHGF", df.parse("MARCH 5 2010"));
//write your code here
return map;
}
public static void removeAllSummerPeople(HashMap<String, Date> map) throws ParseException {
//write your code here
DateFormat df = new SimpleDateFormat("MMMM d", Locale.ENGLISH);
Date startDate = df.parse("JUNE 1");
Date endDate = df.parse("AUGUST 31");
for(Map.Entry<String, Date> pair : map.entrySet()){
Date a = pair.getValue();
if(startDate.compareTo(a)*a.compareTo(endDate)<=0){
map.remove(pair.getValue());
map.remove(pair.getKey());
}
}
}
public static void main(String[] args) {
}
}