To add a third option to what Gregg said, many terminals support ANSI escape sequences. If yours does, then your Java program can print the ANSI "clear screen" sequence to clear the screen. This program will clear the terminal window on many systems:
ANSI escapes are great: you can display colors, move the cursor around, etc. They will work on Windows and on UNIX platforms.
The first Option leaves the cursor at the end of the screen
The second Option.... i didnt get....dont know why!!?? ( I am using windows 98 and "cls" is the command for clear screen in DOS.)
The Third Option also didnt work for me in the beginning. But later got to know that we need to add this in the Config.sys.
restart it and then if we compile our program... it works!!!
I was searching for this only..... But can u please tell me how it works. Is there any web site, ebooks or any books for learning more about ANSI escapes ( about colors and moving the cursor) ..... Please let me know... i am very much interested.
Once again thanks for the help
Regards Vishwas SCJP1.4
author and iconoclast