剑指offer编程总结

1.

public sealed class Singleton5 {
    Singleton5(){
        
    }

    public static Singleton5 Instance{
        get {
            return Nested.instance;
        }
    }
    class Nested {
        static Nested(){
            
        }
        internal static readonly Singleton5 instance = new Singleton5();
    }
}

猜你喜欢

转载自www.cnblogs.com/xiaomao21/p/9290559.html