public class Date { private int month; //variable to store the month private int day; //variable to store the day private int year; //variable to store the year //sets all three fields to -1; public Date() { setMonth(-1); setDay(-1); setYear(-1); } //sets the values by invoking the setDate method public Date(int month, int day, int year) { setDate(month, day, year); } public void setDate(int month, int day, int year) { setMonth(month); setDay(day); setYear(year); } public void setDay(int d) { day = d; } public void setMonth(int m) { month = m; } public void setYear(int y) { year = y; } public int getMonth() { return month; } public int getDay() { return day; } public int getYear() { return year; } //Returns the date in the form mm-dd-yyyy public String toString() { return (month + "-" + day + "-" + year); } }