public class ThreadConfusion
{
public static void main(String[] args)
{
System.out.print("1 ");
synchronized (args)
{
System.out.println(" 2");
try
{
args.wait();
}
catch (InterruptedException e)
{
System.out.println("exception");
}
}
System.out.println("3 ");
} //end of the main method
} // end of the class
1 2
为何O/P为1 2,而不是1 2 3发生了什么事究竟 那边我无能能任何1请向我解释.. 谢谢你
你为什么叫wait()的?它等着你打电话通知() –
更重要的是:你期望调用'args.notify()'谁?这里没有其他线程... – ppeterka