Question: Use Simple Java Please- Create a Date class with three integer instance variables named day, month, year. It has a constructor with three parameters for
Use Simple Java Please-
Create a Date class with three integer instance variables named day, month, year. It has a constructor with three parameters for initializing the instance variables, and it has one method named daysSinceJan1( ). It computes and returns the number of days since January 1 of the same year, including January 1 and the day in the Date object. For example, if day is a Date object with day = 1, month = 3, and year = 2000, then the call date.daysSinceJan1( ) should return 61 since there are 61 days between the dates of January 1, 2000, and March 1, 2000, including January 1 and March 1. Include a DateDemo class that tests the Date class. Dont forget leap years.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
