0
private void display(int[] a) {
    String array = "(" + a.length + ") ";
    for(int i = 0; i < a.length; i++) {
        array += String.format("%-5d", a[i]);
    }
    System.out.print(array + "\r");
}

The code is above. I'm trying to print the output of a sorting algorithm I made but I don't want a ton of lines outputting. I needed to see how well it worked although the carriage return isn't returning to the beginning of the line. I am using eclipse and no I am not running it in the eclipse environment. I'm running it in the Window's command line.

Aertax
  • 19
  • 1
  • 5
  • Possible duplicate of [Java console cursor movemenet](http://stackoverflow.com/questions/40576926/java-console-cursor-movemenet) – Patrick Parker Feb 25 '17 at 02:41
  • [What's a good Java, curses-like, library for terminal applications?](http://stackoverflow.com/questions/439799/whats-a-good-java-curses-like-library-for-terminal-applications). – Elliott Frisch Feb 25 '17 at 02:44

0 Answers0