class Demo extends Thread{
@Override
public void run() {
// TODO Auto-generated method stub
for (int i = 0; i < 3; i++) {
System.out.println("two");
}
}
}
public class ThreadDemo1 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Demo d1=new Demo();
Demo d2=new Demo();
d1.start();
d2.start();
//d1.run();//它仅仅是一个调用对象而已,只是建立线程,没有运行?是什么意思?
//d2.run();
for (int i = 0; i < 3; i++) {
System.out.println("one");
}