使用\b控制符,退格输出
// BackTest
public class BackTest {
public static void main( String[] args ) throws Exception {
System.out.print( "print number: " );
for( int i = 0; i < 10; i++ ) {
System.out.print( "\b" + i );
Thread.currentThread().sleep( 500 );
}
}
}
// BackTest
public class BackTest {
public static void main( String[] args ) throws Exception {
System.out.print( "print number: " );
for( int i = 0; i < 10; i++ ) {
System.out.print( "\b" + i );
Thread.currentThread().sleep( 500 );
}
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货