What is advantage of Singleton class?
This question already has an answer here:
This is not only about java. One difference between singletons and static members is that you may have several singletons that extend or implement a same class or interface. If you need to call a method on one of these singletons, you can rely on polymorphism, which would not be the case with static members.
链接地址: http://www.djcxy.com/p/78824.html上一篇: C#:单例和静态模式之间的差异
下一篇: Singleton类的优点是什么?