Can java execute a timer on the command line by overwriting time on the same line?

HI I am a new Java programmer (very new).

What do I want to do / test (not sure if this is recommended or doable?), We know that

System.out.println("Message");

will display "Message" on the command line. Is it possible to display the current time without reusing system.out.println ()?

Name, for example, instead of displaying:

10:00:01
10:00:02
10:00:03

I want to do this: 10: 00: 0X, where X will continue to count

+3
source share
1 answer

\r ( ) \n ( ), , "", . println \n, System.out.print ( ln part;-), ( flush, , , , , ).

+4

Source: https://habr.com/ru/post/1744441/


All Articles