I am trying to make a 24 hour clock and I want it to increment seconds, minutes, hours in a fixed place like within the Command Shell this.
00:00:03
previous lines are replaced instead of adding lines below like this:
00:00:01
00:00:02
00:00:03
How to make something like this? Here is my code
Clock myClock = new Clock();
while(true) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter ticks");
String ticks = sc.nextLine();
int input = Integer.parseInt(ticks);
for(int i = 0; i < input ; i++) {
System.out.println(myClock.ToTimeFormat());
myClock.Tick();
Thread.sleep(100);
}
}
Thanks for help in advance