下面的代码有点问题,但不知道是什么原因,请大侠指点迷经
public class Test001 extends Thread
{
private int countDown=5;
private static int threadCount=0;
public Test001(){
super(""+ ++threadCount);
start();
}
public String toString(){
return "#"+getName()+":"+countDown;
}
public void run(){
while(true){
System.out.println(this);
if(--countDown==0) return;
}
}
public static void main(String[] args){
new Test001(Thread.MAX_PRIORITY);
for(int i=0;i<5;i++){
new Test001(Thread.MIN_PRIORITY);
}
}
}