Thread类

package org.hanqi.thread;

public class test04 extends Thread {
public void run(){
for(int i=0;i<10;i++){
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("hello!");
}
}
public static void main(String[] args )
{
test04 t1=new test04();
t1.start();
}
}

posted @ 2016-03-15 15:45  lizhe313  阅读(110)  评论(0编辑  收藏  举报