/**
* 描述:控制台打印进度条
*
* @author yanfuyou
* @date 2022/4/24
*/
public class Speed {
public static void main(String[] args) throws InterruptedException {
System.out.printf("%s", "进度:\n");
for (int i = 1; i < 20; i++) {
Thread.sleep(500);
System.out.print("\r");
for (int j = 0; j < i; j++) {
System.out.print("#");
System.out.flush();
}
}
}
}
控制台模拟进度条
最新推荐文章于 2024-02-14 16:32:21 发布