import java.util.Comparator; class Date implements Comparator { private int day, month, year; public Date(String str) throws IllegalMonthException { //format of str is DD-MM-YY String day=str.substring(0,2); String month=str.substring(3,5); String year=str.substring(6,8); this.month=Integer.parseInt(month); if(this.month>12||this.month<1) throw new IllegalMonthException(); } public int compare(Object o1, Object o2) { } public boolean equals(Object o) { } public String toString() { /* prints a date in the following format: day-month-year (in four digits) */ } }