Sunday, September 28, 2014

How to Clear a Screen and Put a New One in Java

Instructions

    1

    Enter the following code at the beginning of your Java program to import the required components:

    import java.lang.*;

    2

    Enter the following code into the Main method of your Java application:

    public void ClearConsole()

    3

    Enter the following code between the ClearConsole brackets to create a loop:

    for (int i = 0; i < 50; i++)
    System.out.println("n");

    4

    Enter the following code within your program whenever you want to clear the console and start with a blank screen:

    new Main().ClearConsole();



No comments:

Post a Comment