本帖最后由 小洋人最happy 于 2012-11-19 23:03 编辑
class SingleDemo2
{
private static Single s = null;
private Single(){}
public static Single getInstance()
{
if(s==null)
s = new Single();
return s;
}
}
class Single
{
private single(){}
private static single s = new Single();
public static Single getInstance()
{
return s;
}
}
|