- package com.cvicse.daofactory;
- public class SingleSpoon {
- private static SingleSpoon instance;
- private SingleSpoon(){
- //内部可以做一些初始化成员变量的操作
- }
- public static synchronized SingleSpoon getInstance(){
- if (instance == null) {
- instance = new SingleSpoon();
- }
- return instance;
- }
- }
单列模式
猜你喜欢
转载自liyonghui160com.iteye.com/blog/2089698
今日推荐
周排行