Question: Design a class named Date that meets the following requirements: Three data fields year, month, and day for representing a date A constructor

Design a class named Date that meets the following requirements: 

■ Three data fields year, month, and day for representing a date
■ A constructor that constructs a date with the specified year, month, and day
■ Override the equals method
■ Override the hashCode method. (For reference, see the implementation of the Date class in the Java API.)

Step by Step Solution

3.53 Rating (156 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

public class Exercise2713 class Date1 private int year private int month private int day pub... View full answer

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 Introduction to Java Programming and Data Structure Questions!