下面是线程B的RUN()
public void run()
{
for(int i =100 ;i<=105;i++)
{
System.out.println("ID"+i+"素数?"+isZS(i));
try
{
Thread.sleep(200);
}
catch(InterruptedException e)
{}
}

tcStoped =false;
}
下面是线程A的run()
public void run(){
while( !ThreadCalculate.tcStoped )
{
System.out.println(new SimpleDateFormat().
format(new Date()));

try
{
Thread.sleep(200);
}
catch(InterruptedException e)
   {}
}

}
现在是当B执行完for循环的时候,还在sleep中,而这时a又执行了一遍,我想让b完成任务时候,a马上停止。这要在a中while()里怎么写呢?interrupted()能做到吗?怎么写呢?