I want the screen to get clear everytime the loop runs, although in this case it seems silly but for example i can create a new thread,make it print something and ask it to sleep, and when it wakes up i want the screen to get clear(so that i can notice the difference before clearing the screen and after clearing the screen......
So, speaking directly, i want the way to clear the screen in java.....
There is no simple way to do that. You might want to take a look at the link that Ankit posted. However do not go for an overkill like using another library to clear your screen. May be what you need is a method that will print 100 blank lines and you can invoke this method whenever required.
As was stated before, clear screen doesn't depend on any programming language, it depends on an Operating system. Read Mark Uppeteer's link. The only reason clear screen doesn't work in Java is because Java is platform independent and consoles are bound to the platform.
So you're not to check java for a clear screen command, you're to check your console if it allows it, then in what way it allows it.
Oracle Certified Professional: Java SE 6 Programmer
Oracle Certified Expert: Java EE 6 Web Component Developer
Oracle Certified Expert: Java EE 6 Enterprise JavaBeans Developer
Joined: Dec 19, 2009
I'm doing my program on command prompt....
How can i get how to clear screen in cmd using java?