
public static void main(String[] args)...{
MyThread mt=new MyThread();
mt.start();
int index=0;
while(true)...{
if(index++==10)...{
mt.stopThread();
break;
}
System.out.println(Thread.currentThread().getName());
}
System.out.println("main() exit!");
}
}
class MyThread extends Thread...{
private boolean bStop=false;

