简简单单的singleton
来源:互联网 发布:python能开发前端吗 编辑:程序博客网 时间:2024/04/30 04:46
做Java的singleton时,别忘了处理clone方法哦!
范例 ( 摘自某不知名英文文档 )
public class SingletonObject
{
private SingletonObject()
{
// no code req'd
}
}
范例 ( 摘自某不知名英文文档 )
public class SingletonObject
{
private SingletonObject()
{
// no code req'd
}
public static SingletonObject getSingletonObject()
{
if (ref == null)
// it's ok, we can call this constructor
ref = new SingletonObject();
return ref;
}
public Object clone()
throws CloneNotSupportedException
{
throw new CloneNotSupportedException();
// that'll teach 'em
}
}
- 简简单单的singleton
- 一段简简单单的javascript
- 简简单单的生活!
- 简简单单的,就好。。
- 简简单单的我
- 一个简简单单的问题
- “简简单单”的问题~~~~
- 简简单单的生活
- 简简单单的幸福
- 简简单单的讲sort
- 简简单单的排序算法
- 简简单单的爬虫
- 简简单单
- 简简单单
- 简简单单
- 简简单单
- 简简单单
- 简简单单
- ADO链接字符串编写示例大全
- 今天经理正式通知我们了,他要走了。。。。。。
- [Avalon] Quick Start
- 关于“愤青”,随便聊聊
- ASP公用数据访问类
- 简简单单的singleton
- DBMS_METADATA
- .png文件压缩利器Pngout !
- 4个人的开发团队就足够了
- 用Delphi打造RealPlayer播放器
- 作bs的为了以后吃饭 必须要学点精深的东西。学什么那。郁闷
- Cocoon入门
- java.security.Principal翻译
- 大学 四字真言