while
(
true
) {
Thread.sleep(
1000
);
System.out.println(
"----------"
);
}
要限制第几次输出结束:例如: 输出第五次结束
int a = 0;
while
(a<5
) {
Thread.sleep(
1000
);
a+= 1;
System.out.println(
"-----"
);
}
标签:输出,1S,Java,Thread,System,while,sleep,println,每隔
来源: https://www.cnblogs.com/bichen-01/p/12108759.html