class TheadDemo1
{
public static void main(String [] args){
Thread tt=new Thread(new TestThread());
tt.start();
int index=0;
while(true)
{
if(index++=100)
try{tt.join(10000);} catch(Exception e){}
System.out.println("main():"+Thread.currentThread().getName());
}
}
}
class TestThread implements Runable{
public void run{
while(true)
System.out.println("run():"+Thread.currentThread().getName()));
}
}