Question: In java please a. Using UML notation, design a class called MyTime in Microsoft Word to represent an instance of time. The class contains: a.

In java please

In java please a. Using UML notation, design a class called MyTimein Microsoft Word to represent an instance of time. The class contains:a. Data fields hour, minute and second to represent time. b. A

a. Using UML notation, design a class called MyTime in Microsoft Word to represent an instance of time. The class contains: a. Data fields hour, minute and second to represent time. b. A no-arg constructor to create a Time object with values of current time. c. A constructor to construct a Time object with specified values for hour, minute and second. d. A constructor to construct a Time object with specified elapsed time since midnight January 11970 in milliseconds. The values of the data fields will represent this time. e. Three getter methods for the data fields. f. A method called setTime(long elapsedTime) that sets a new time for the object using elapsed time. Here is code for the constructor in part (d) public MyTime (long elapsedTime) \{ setTime (elapsedTime); f And here is code for the setTime() method public void setTime(long elapsedTime) \{ // Obtain the total seconds since the midnight, Jan 1,1970 long totalseconds = elapsedTime / 1000 ; // Compute the current second in the minute in the hour c. Write a test program that will: - Create three MyTime objects as shown below. - After creating each MyTime object, display the time in format Hour:minute:second MyTime time1 = new MyTime () / /display timel MyTime time2 = new MyTime (555550000); / /display timel MyTime time3 = new MyTime (5,23,55); / /display time1

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!