我有一段這樣的代碼
Dotry try1=new Dotry("線程1");
Dotry try2=new Dotry("線程2");
try1.start();
try1.join();
Thread.sleep(2000);
try1.wait();
try2.start();
調試後報錯我想問一下時怎麼回事啊?
class Dotry extends Thread{
String name;
public Dotry(String name){
this.name=name;
}
public void run(){
for(int i=15;i>0;i--){
System.out.println(name+"在運行");
}
}
}
http://macleo.iteye.com/blog/625873