I would like to know if there are other possibilities besides for example running a series of '\ n'.
public void clrscrn(){
for (int i = 0; i < 50; ++i)
System.out.println();
}
I would like to know if there are other possibilities besides for example running a series of '\ n'.
public void clrscrn(){
for (int i = 0; i < 50; ++i)
System.out.println();
}
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();