Java console: return to the start of line

/ Published in: Java
Save to your folder(s)

Returns the cursor on the console to the start of the line.

Copy this code and paste it in your HTML
  1. public class Foo {
  2. public static void main(String[] args) throws Exception {
  3. System.out.print("old line");
  4. Thread.sleep(3000);
  5. System.out.print("\rnew");
  6. }
  7. }

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.