java clear console
// in JDK 11 you can do:
// It can be better than exec("cls") because it even works in intellij.
// Also, putting println() in a for loop is worse because there is a
// noticable delay between calls. This code does a single call, but
// stacks a ton of '\n's.
private void clearConsole() {
System.out.println(System.lineSeparator().repeat(100));
}