51,411
社区成员
发帖
与我相关
我的任务
分享
public static void main(String args[])
{
Thread t = new Thread(new Runnable(){
private final Object threadBlo = new Object();
public void run()
{
try
{
synchronized(threadBlo)
{
System.out.println("start to wait...");
threadBlo.wait();
}
}
catch(InterruptedException e)
{
System.out.println("interrupted!");
}
}
});
t.start();
try{
Thread.sleep(3000);}catch(InterruptedException e){}
t.interrupt();
}