Javaでコマンドラインに出力されたテキストをクリアするにはどうすればよいですか? 印刷後にクリアText1
して で上書きしたいText2
。このコードを検索して見つけましたが、機能しません。
public class className {
public static void main(String[] args) throws IOException {
System.out.println("Text1");
Runtime.getRuntime().exec("cls");
System.out.println("Text2");
}
}