Jump to content

clear screen code in Java.

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
sadia_abbid

sadia_abbid

    Newbie

  • Members
  • Pip
  • 1 posts
Can any body please tell me what code is used for clear screen in java? For example in c++ "system("CLS"); " is used just like this what code is used in java for clear screen? Please help. Thanks!

#2
farrell2k

farrell2k

    Learning Programmer

  • Members
  • PipPipPip
  • 60 posts
The only way to do it in Java is:

for (int x = 0; x < 50; x++) {
System.out.println("\n");
}

You could also do System.out.println(" ") or anything similar.