注意:我需要在控制台中清除以前的打印值,并且需要将光标定位在[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
我在此online compiler中获得此输出但在其他编译器中没有
答案 0 :(得分:-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:)");