本帖最后由 帅气的冬瓜 于 2013-11-27 11:07 编辑
private Single(){}
private Single s=new Single();
private static Single getInstance(){
retutn s;
}
private Single (){}
private Single s=new Single();
private static synchronized Single getInstance(){
return s;
}
上面这两种有何区别,在以后的编程中怎样应用?
|
|