Develop and implement a
class Date that represents a date. A Date object should have 3
attributes: day of the month, the month, the year. The class should
provide the following constructors:
The class should provide the following behaviors:
- a no argument constructor that configures a new date that
represents January 1, 2000.
- a constructor that configures a new date with the day, month
and year as parameters.
Also write a DateTest class that creates several Date objects
using information which is read from the user, and prints a String
representation of each date.
- int getDay(): returns the day of the associated date.
- int getMonth()
- int getYear()
- void setDay(int d)
- void setMonth(int m)
- void setYear(int y)
- int compare(Date d): returns -1 if this Date object occurs
before d, 0 if this Date is the same as d, and 1 if d comes before this
- String toString(): returns a text representation of the Date
object. Over-ride the method inherited from the Object class.
- boolean equals(): over-ride the method inherited from the Object class.