Exemplo n.º 1
0
    public static void SubMain(String[] args)
    {
        SingletonThreadSafe1 instance = SingletonThreadSafe1.GetInstance();

        Console.WriteLine(instance);

        SingletonThreadSafe1 anotherInstance = SingletonThreadSafe1.GetInstance();

        Console.WriteLine(anotherInstance);

        if (instance == anotherInstance)
        {
            Console.WriteLine("They are the same instance");
        }
    }