Design a class named Clock that contains private data fields….solved

$20.00

Download Details:

  • Name: Clock-og0m8g.zip
  • Type: zip
  • Size: 10.86 KB

Category:

Description

5/5 - (3 votes)

Design a class named Clock that contains private data fields for startTime and endTime, no argument constructor that initializes the startTime to the current time, a method named start() that resets the startTime to the given time, a stop() method that sets the endTime to the given time and a getElapsedTime() method that returns the elapsed time in seconds. Create a TestClock class to construct a Clock instance and return the elapsed time. Command line arguments to send the start and end times. Use the java.time classes.