answersLogoWhite

0

There is no way to clear the screen inJAVA. It seems that you are a beginner in Javaand just migrated from age old Turbo C.

The reason because there is no clear screen is that you will never need it when you develop actual Javaprograms. Have you ever seen an application that clears it screen (apart from DOS based applications).

When you develop an application for a client, you do not expect him/her to go through your clumsy console. The console is available only for debugging purposes or for learning the language. When you deploy your application, you always have an interface associated with it (like your own internet browser or any other window).

So stop worrying about clearing the screen.

Of course, you can still manually clear the screen of text by printing out enough blank lines to run all other text out of the terminal window.

Most console windows will start of with about 25 lines of text, so something like the following should do what you want in most cases:

for(int i = 0; i < 40; ++i) {

System.out.println();

}

User Avatar

Wiki User

14y ago

Still curious? Ask our experts.

Chat with our AI personalities

SteveSteve
Knowledge is a journey, you know? We'll get there.
Chat with Steve
JudyJudy
Simplicity is my specialty.
Chat with Judy
FranFran
I've made my fair share of mistakes, and if I can help you avoid a few, I'd sure like to try.
Chat with Fran

Add your answer:

Earn +20 pts
Q: How do you clear screen in java eclipse?
Write your answer...
Submit
Still have questions?
magnify glass
imp