Question: Java Write the class definition for a Date class that contains three integer data members: month, day, and year. Include a default constructor that assigns

Java

Write the class definition for a Date class that contains three integer data members: month, day, and year. Include a default constructor that assigns the date 1/1/2000 to any new object that does not receive arguments. Also include a function that displays the Date object. Write a main() function in which you instantiate two Date objects -- one that you create using the default constructor values, and one that you create using three arguments -- and display its values. Save the file as Date.java. You will use the Date class in other assignments later.

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!