0
I have a big question!!!đHow to clear the console screen when running java console app???đź
For example: I have this very, very simple code:class TestClass { public static void main(String[] args) { System.out.println("Hello"); System.out.println("Hi"); }}I want to clear screen and print "Hi". How to do it??? Please tell me!!! Thanks!!!đđđ
2 Answers
+ 1
If you are running java from the command prompt, maybe you could get away with
try {
Runtime.getRuntime ().exec ("cls");
} catch (IOException e) {}
It would be more reliable to print alot of blank lines to give the impression that the screen is clear. That works anywhere.
0
Ok! I will try it!!! Thanks for your help!!!đđđ