Problem Statement
Date Class
You are in charge of developing a java class that represents a date with year, month and day. You must
implement at least
a class with
at least the following methods:
Method name
Parameters and Return type
Description
constructor
Parameters:
Constructor method for passing down a
date
- An integer that represents the year of
the date
- An integer that represents the month of
the date
- An integer that represents the day of
the month
setToNextDay
Parameters:
The method must set the current date
object value to the next day
- No apply
Return Type:
- void
toString
Parameters:
Returns the String representation of a date
object in the format yyyy/MM/dd
- No apply
Return Type:
- [Link]
compareTo
Parameters:
- An object of date type
Return Type:
[Link]
Compare the current date object and the
one passed as parameter. If both objects
represent the same date the method must
return 0. If the current date object
represents a date previous to the date
object passed as parameter, the method
must return -1 otherwise the method must
return 1.