摘要: 今天在看设计模式的单例模式时,无意中发现了C#的延迟加载实现方式。我就把我见到的现象和大家分享下,有错误欢迎拍砖。public sealed class b { internal static int a = 0;static b() { a = 4; } } public sealed class Singleton { internal static int i = 0; Singleton() { } public static Singleton Instance { get { return Nested.instance; } } class Nested { static Nes 阅读全文
posted @ 2011-03-11 11:26 信封牛 阅读(650) 评论(1) 推荐(0) 编辑