How can I return to the start of a line in a console?

后端 未结 3 576
故里飘歌
故里飘歌 2020-12-03 06:42

How can I return to the start of a line and overwrite what has already been output on the console? The following does not appear to work:

System.out.print(my         


        
3条回答
  •  情深已故
    2020-12-03 07:30

    My guess (And it is a guess) would be that '\r' does work, but the console you're using doesn't treat it as you'd expect. Which console are you using? If it's something like console output in your IDE, have you tried it on a real command-line instead?

提交回复
热议问题