Print a carriage return in java on windows on console

后端 未结 3 1383
忘掉有多难
忘掉有多难 2020-12-19 02:03

On my OS X machine, the following line gives me a nice and easy way to track the state of my loops:

for (int index = 0; index < 100; index++)
    for (int         


        
3条回答
  •  青春惊慌失措
    2020-12-19 02:52

    By "Windows" you mean cmd.exe? And you want to overwrite to the line you previously output, right? Unfortunately I think you need to invoke this Win32 API somehow in order to achieve it

    • SetConsoleCursorPosition
      • Cf. Calling Win32 API method from Java

    Maybe other Java gurus can provide better answer ...

提交回复
热议问题