- public class OnlyOne{
- private static OnlyOne one = new OnlyOne();
- private OnlyOne(){}
- public static OnlyOne getInstance() { return one; }
- }
- //该片段来自于http://www.codesnippet.cn/detail/060920135693.html
来源: http://www.codesnippet.cn/detail/060920135693.html