摘要:
1.join与interrupt的用法
class Sleeper extends Thread
{
private int duration;
public Sleeper(String name,int sleepTime)
{
super(name);
duration=sleepTime;
start();
}
public void run(){
try {
sleep(duration);
} catch (Exception e) {
System.out.println(getName()+" was interrupted."+"isInterrupted():"+isInterrupted());
return;
}
System.out.println(getName()+" has awakened"); 阅读全文
posted @ 2014-03-12 00:17
上校
阅读(316)
评论(0)
推荐(0)
浙公网安备 33010602011771号