所以这是我的问题,我怎样才能让线程停止,我对线程不是很精通,但我读过的少量信息告诉我这应该可以工作。
public class testestes {
static volatile boolean key;
public static void main (String []args)
{
key=true;
Thread thread=new Thread(new Runnable()
{
public void run()
{
while(key)
{
System.out.println("running");
}
}
});
thread.start();
key=false;
}
}