标签:rate try current except cep stack 名称 main name
package Mypackage;
public class Mythread extends Thread{
public Mythread(String name){
super(name);
}
public void run(){
for(int i=0;i<100;i++){
System.out.println("当前线程的名称:"+getName()+" "+i);
}
}
public static void main(String[] args){
new Mythread("我的新线程").start();
for(int i=0;i<100;i++){
if(i%20==0){
Mythread mythread=new Mythread("新加入的jion线程");
mythread.start();
try {
mythread.join();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
System.out.println(Thread.currentThread().getName()+" "+i);
}
}
}
标签:rate try current except cep stack 名称 main name
原文地址:http://www.cnblogs.com/llforeverlove/p/6360899.html