public class EnglishDate extends MyDate // difference is English Dates use the form DD/MM/YY or DD/MM/YYYY (date first, month second) { public EnglishDate(int day, int month, int year) // if passed three ints, just rearrange the order for the MyDate constructor { super(month, day, year); } public EnglishDate(String date) // if a String, then first two digits are date, next two are month, last 2 or 4 are year { super(); // required to call no-arg parent constructor super.setDate(Integer.parseInt(date.substring(0,2))); // now reset date, month and year super.setMonth(Integer.parseInt(date.substring(3,5))); if(date.length()==8) super.setYear(Integer.parseInt(date.substring(6,8))+2000); else super.setYear(Integer.parseInt(date.substring(6,10))); } @Override public String toString() // override toString to output in English format { return super.getDate() + "/" + super.getMonth() + "/" + super.getYear(); } }