I have a class extending the Thread class. In its run method there is a System.out.println
statement. Before this print statement is executed I want to clear the console. How can I do that?
I tried
Runtime.getRuntime().exec("cls"); // and "clear" too
and
System.out.flush();
but neither worked.