Im very new to java so im sorry if this hurts your eyes.
So im supposed to make a clock that for 3 minutes after starting the program it prints the time starting from 16:28:58 but i get this message when i run it
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
import java.util.concurrent.TimeUnit; public class clockApp { //Data private int hours; private int minutes; private int seconds; // Methods void setHour(int h) { hours=h; } void setMin(int m) { minutes=m; } void setSec(int s) { seconds=s; } void tick() { if (hours==23 && minutes==59 && seconds==59){ hours=0; minutes=0; seconds=0; } if (minutes==59 && seconds==59){ hours=hours+1; minutes=0; seconds=0; } if (seconds==59){ minutes=minutes+1; seconds=0; } else{ seconds=seconds+1; } } public String toString() { String a=Integer.toString(hours); String b=Integer.toString(minutes); String c=Integer.toString(seconds); string z=a+":"+b+":"+c; return z; } public static void main (String args[]) throws Exception{ clockApp idk=new clockApp(); idk.setHour(16); idk.setMin(28); idk.setSec(58); for (int i=0;i<181;i++){ System.out.println(idk.toString()); idk.tick(); TimeUnit.SECONDS.sleep(1); } } }