Is it possible to rewrite previous line in console?
问题 I'm trying to create process animation in my console app. Is it possible to rewrite previous lines for this needs? I know about \r but it works only with current line. If it is not possible, how could I achieve animation effect? Thanks. My console is standard Ubuntu 12.04 terminal emulator. Thanks to @MrSmith42 I made this simple demo, which shows way to overwrite lines: public class Flush { public static void main(String[] args) { for(int i = 0; i < 5; i++) { System.out.println("************