real world example of sinleton design pattern

97

real world example of sinleton design pattern -

class Singleton
{
    private static Singleton instance;

    private Singleton() {}

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

            return instance;
        }
    }
}

Comments

Submit
0 Comments