Design a class named clock that contains private data


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.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Design a class named clock that contains private data
Reference No:- TGS0974953

Expected delivery within 24 Hours