Java OOP GUIDE / WORK DATE CLASS Topics
TASK –
PART 1 – DATE CLASS: INSTANCE VARIABLES INCOMPLETE
-
isLeapYear()
– true if the year is a leap year -
setNextDay() – moves the date to the next day (ie: Jan 2, 1972 becomes Jan 3, 1972) -
getNextYear() – returns the number of the next
year -
getNextDay() – returns the number of the next day -
nextMonth() – returns the number of the next
month -
toString() – returns a date in the form of
January 3rd, 1972 -
maybe:
calculate weekday? Ie:
Monday -
isBefore(Date d) – returns true of the date is
before Date d -
isAfter(Date d) - … Consider
using something like this for Date’s constructor: public
|
|