Question: Build a class called MyDateTime.java This class should have 6 properties: month, day, year, hour, min and sec. Also add the appropriate set and get

 Build a class called MyDateTime.java This class should have 6 properties:

Build a class called MyDateTime.java This class should have 6 properties: month, day, year, hour, min and sec. Also add the appropriate set and get methods, display method, toString method and main method. Main() should be used to test this class. Also add 2 constructors to the MyDateTime class. One that takes no arguments and initializes the data to all 0s and "" (empty strings). And one constructor that takes all 6 arguments, one argument for each property. Lastly in the main() method instantiate a MyDate Time object by calling the constructor that takes all 6 arguments, then call the display method to display the data. Main Testing Code rightarrow MyDate Time md1; md1 = new MyDateTime (1, 1, 2017, 9, 0, 0); md1.display()

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!