Question: public class HW2_ Exercise10_01 { public static void main(String[] args) { Time time1 = new Time(); System.out.println(Hour: + time1.getHour() + Minute: +
public class HW2_ Exercise10_01 { public static void main(String[] args) { Time time1 = new Time(); System.out.println("Hour: " + time1.getHour() + " Minute: " + time1.getMinute() + " Second: " + time1.getSecond()); Time time2 = new Time(555550000); System.out.println("Hour: " + time2.getHour() + " Minute: " + time2.getMinute() + " Second: " + time2.getSecond()); } } class Time { private int hour; private int minute; private int second; public Time() { this(System.currentTimeMillis()); } public Time(long elapsedTime) { setTime(elapsedTime); } public Time(int hour, int minute, int second) { //implementation } public int getHour() { //Implementation } public int getMinute() { //implementation } public int getSecond() { //implementation } //Refer to Listing 2.7 on page 52 of your textbook to implement this method public void setTime(long elapsedTime) { // Obtain the total seconds since the midnight, Jan 1, 1970 // Compute the current second in the minute in the hour // Obtain the total minutes // Compute the current minute in the hour // Obtain the total hours // Compute the current hour } }
I need help writing the rest of this code. The book is called Introduction to Java Programming 10th edition. Daniel Liang. Java
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
