1
I would like to know if there are other possibilities besides for example executing a series of ' n'.
public void clrscrn(){
for (int i = 0; i < 50; ++i)
System.out.println();
}
1
I would like to know if there are other possibilities besides for example executing a series of ' n'.
public void clrscrn(){
for (int i = 0; i < 50; ++i)
System.out.println();
}
1
Two possibilities I know:
final String sisOpe = System.getProperty("os.name");
if (sisOpe.contains("Windows")){
Runtime.getRuntime().exec("cls");
}else{
Runtime.getRuntime().exec("clear");
}
or
System.out.print("\u001b[2J");
System.out.flush();
Browser other questions tagged java
You are not signed in. Login or sign up in order to post.
Advantages and disadvantages of each ?
– jorge saraiva
I honestly don’t know Jorge. But I heard about the first being very ugly. Perhaps by invoking a cmd command.
– Ismael