class Single
{
private static Single s=null;
private Single(){}
public static Single getInstance()
{
if(s==null)
{
synchronized(Single.class)
{
if(s==null)
s=new Single();
}
}
return s;
}
}
class SingleDemo999
{
public static void main(String[] args)
{
Single.getInstance();
}
}
第九行 synchronized 你把o写成C了
|