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();
}
}

原文地址:https://www.cnblogs.com/lizhe313/p/5279806.html