0

注意:我需要清除控制台中之前打印的值,需要将光标定位在 [row][column]=0

System.out.println("Hello World");
System.out.println("Hello Country");
System.out.println("\033[0;0H"); //need to apply the escape sequence here
System.out.println("Happy:)");

预期输出:

Happy:)
Hello Country

我在这个在线编译器中得到这个输出,但在其他编译器中没有

4

1 回答 1

-1

要获得下一行,只需添加“\n”:

System.out.println("\nHello World");
System.out.println("\nHello Country");
System.out.println("\nEsc[2J"); //need to apply the escape sequence here
System.out.println("\nHappy:)");
于 2018-05-21T12:33:57.983 回答