任何人都可以在这段实现单例设计模式的 Java/C# 代码中找出问题所在。
有人能帮我找出这个代码片段实现中的缺陷吗?
class Singleton{
public static Singleton Instance() {
if (_instance == null)
_instance = new Singleton();
return _instance;
}
protected Singleton() {}
private static Singleton _instance = null;
}
最佳答案
关于c# - 实现单例设计模式[请建议],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7119304/