.net 流氓
天下无难事,有志者成之;天下无易事,有恒者得之。
摘要: 在学习 Design&Pattern 的 Singleton Pattern 的时候,因为静态初始化是在 .NET 中实现 Singleton 的首选方法. 1 public sealed class Singleton 2 { 3 static readonly Singleton instance = new Singleton(); 4 5 static Singleton() 6 { 7 } 8 9 Singleton()10 {11 }12 13 public static Singleton Instance14 {15 get16 {17 return instance; 阅读全文
posted @ 2011-06-29 09:29 .net 流氓 阅读(5576) 评论(0) 推荐(3) 编辑