一个简单的问题

X309669600 X309669600 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
下面的代码有点问题,但不知道是什么原因,请大侠指点迷经
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);
}
}
}
...全文

相关推荐

评论 2
收藏 已收藏
分享
返回顶部
X309669600
Java SE 62,621 成员 307,251 内容