Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

When running a java program I keep getting the error: Exception in thread “main” java

When running a java program I keep getting the error: Exception in

thread “main” java.lang.ArrayIndexOutOfBoundsException: 0
at TestClock.main(TestClock.java:16). My question is: how do I modify code(example) so that it compiles and runs and not so much a http://lmgtfy.com/?q=Exception+in+thread+%22main%22+java.lang.ArrayIndexOutOfBoundsException%3A+0
//I am using netbeans
I have attached the java classes: TestClock, Clock

import java.time.*;public class Clock {private LocalTime startTime;private LocalTime stopTime;public Clock() {startTime = LocalTime.now();}//time start number 1public void start(LocalTime time) {startTime = time;}//time stop number 2public void stop(LocalTime time) {stopTime = time;}//time difference: number 1 – number 2 = elapsed timepublic int getElapsedTime() {return (stopTime.toSecondOfDay() – startTime.toSecondOfDay());}}
Background image of page 1

Step-

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"