单例设计模式
class Single
{
private static Single s = new Single();
private Single(){};
public static Single getInstance()
{
return s;
}
}
延迟加载
class Single
{
private static Single s = null;
private Single(){};
public static Single getInstance()
{
if(s == null)
s = new Single();
}
}