1 public sealed class Singleton 2 { 3 private Singleton() 4 { 5 6 } 7 8 private static Singleton instance = new Singleton(); 9 10 public static Singleton Instance11 {12 get13 {14 return instance;15 }16 }17 };
本文共 329 字,大约阅读时间需要 1 分钟。
1 public sealed class Singleton 2 { 3 private Singleton() 4 { 5 6 } 7 8 private static Singleton instance = new Singleton(); 9 10 public static Singleton Instance11 {12 get13 {14 return instance;15 }16 }17 };
转载于:https://www.cnblogs.com/wanderingzj/p/5351741.html