Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

cls java

import java.io.IOException;
import java.util.Scanner;

public class LimpaConsole {
    public static void main(String[] args) throws IOException, InterruptedException {
        Scanner scanner = new Scanner(System.in);
        System.out.println("Teste");
        String texto = scanner.next();

        //Limpa a tela no windows, no linux e no MacOS
        if (System.getProperty("os.name").contains("Windows"))
            new ProcessBuilder("cmd", "/c", "cls").inheritIO().start().waitFor();
        else
            Runtime.getRuntime().exec("clear");

    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: string programs in java 
Java :: java print array backwards 
Java :: split number java 
Java :: timestamp to date java 
Java :: assert throws exception java 
Java :: initialize scanner java 
Java :: Java print class type 
Java :: radio button java swing 
Java :: does finally block executed after crash 
Java :: Add delay to code in Android 
Java :: requestmapping post 
Java :: joining an array of strings in java 
Java :: isnull java 
Java :: count occurrences of character in string java 8 
Java :: empty set java 
Java :: Java Create ArrayList in Java 
Java :: arraylist to array java 
Java :: datatypes in java 
Java :: how to fill a 2d array in java 
Java :: Java NoClassDefFoundError but class is there 
Java :: threads array java 
Java :: statusbar text color android 
Java :: java inline conditional 
Java :: Java Writer Using FileWriter 
Java :: How to efficiently find the longest common subsequence of two strings, in Java? 
Java :: Could not determine java version from 
Java :: java object to int 
Java :: java throw an exception 
Java :: how to update java runtime 
Java :: 2d array java 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =