📜  sinleton 设计模式的真实世界示例 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:41.630000             🧑  作者: Mango

代码示例1
class Singleton
{
    private static Singleton instance;

    private Singleton() {}

    public static Singleton Instance
    {
        get
        {
            if (instance == null)
                instance = new Singleton();

            return instance;
        }
    }
}