By default there is no function in Java that does this, cause its platform independent.
The only way to do so is to call up the CMD's '
cls' function and this thing makes the code messy and sometimes doesn't work out on the same window as your program. But anyway, the code for that'd be:
Code:
Runtime.getRuntime().exec("cmd cls");
Or maybe you can print a few blank lines via a loop to fake it. But trust me, thats way better than calling up the command's '
cls' and making your code messy all over.
Also, it isn't really that important to refresh the screen and start all over, just to make it look better. Instead, concentrate on your functionalities of the program.