public class test implements Runnable{
public static void main(String args[]){
test t=new test();
Thread tt = new Thread(t);
tt.start();
}
public void run(){
for(;;){
try{
Thread.sleep(1000);
}
catch(InterruptedException e){}
System.out.println("Hello");
}
}
}
每隔一秒钟显示一个字符串“Hello”
最新推荐文章于 2022-11-20 15:02:36 发布