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
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started