Question: ki. Make SpecialDate immutable type2 Q2. Implement equality method in SpecialDate such that TestDate Q3. Use Git with every step completed. works correctly. class SpecialDate

 ki. Make SpecialDate immutable type2 Q2. Implement equality method in SpecialDate

ki. Make SpecialDate immutable type2 Q2. Implement equality method in SpecialDate such that TestDate Q3. Use Git with every step completed. works correctly. class SpecialDate { int year; int month; int day; public SpecialDate(int day, int month, int year) { this.day = day; this.month = month; this.year year; } } public class TestDate { public static void main(String [] args) { //Step1: create an instance of set type as HashSet 1/Step 2: create four birthdays of type SpecialDate // Ahmad 1/1/1990 // Salem 10/2/1994 // Jaber 5/9/2000 // Samer 1/1/1990 I/Step 3: Add these date to HashMap //Step 4: Using equals(), compare the birthdays objects // of Samer & Ahmad birthdays objects in the map. //Step 5: You discovered that Samer birthday is 1/1/1991 // Fix Samer birthday using the instance created in Step 2 // Lookup and print Samer birthday from the map } }

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!