Question: IN JAVA, Write Date class and include the following variables and methods: (1) Include month, day, and year as private instance variables. Use int type
IN JAVA,
Write Date class and include the following variables and methods:
(1) Include month, day, and year as private instance variables. Use int type for all the variables.
(2) Include two constructors, the default constructor and the three-parameter constructor. The default constructor should set the date to 1/1/2000. The three-parameter constructor will include a given month, day, and year as parameters.
(3) Include get and set methods for all three instance variables.
(4) Include toString method to return the date in month/day/year format as a string.
(5) Include printDate method to print the date in month/day/year format.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
