Question: I don't understand how to compare one date with another one and how to write codes in java, the first picture is the purpose and

 I don't understand how to compare one date with another oneand how to write codes in java, the first picture is the

I don't understand how to compare one date with another one and how to write codes in java, the first picture is the purpose and the second one is the codes in a Tester file

PS: There are many tasks in the assignment I don't know how to do, but there is no way to upload files on Chegg, so I wonder is there any methods that I could get the codes of what I need

Thanks in advance

/* equals * Purpose: determines whether the month, day and year of * this instance of Date is equal to other's month, day, year * * Parameters: Date other * * Precondition: other is not null and is a valid Gregorian date * * Returns: true if this Date equals other date, false otherwise * | TODO... public static void dateEqualsTests() { // TODO: // uncomment the following to test your implementation Date d = new Date("January", 15, 2018); Date dEqual = new Date("January", 15, 2018); Date derDiff = new Date("January", 15, 2019); Date dmthDiff = new Date("February", 15, 2018); Date dDayDiff = new Date("January", 10, 2018) Date dDefault = new Date(); displayResults (d.equals(d), "Date Equals Tests - same object"); displayResults (d.equals(dEqual), "Date Equals Tests - different objects, equal date"); displayResults (dEqual.equals(d), "Date Equals Tests - different objects, equal date"); displayResults (d.equals(dyrDiff) == false, "Date Equals Tests - different objects, years differ"); displayResults (!dMthDiff.equals(d), "Date Equals Tests - different objects, months differ"); displayResults (!d.equals(dDayDiff), "Date Equals Tests - different objects, days differ"); displayResults (!dDefault.equals(dDayDiff), "Date Equals Tests - different objects, all fields differ")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!