.net 2.0下C#单例模式的精简写法!

internal static class Singleton
{
    
public static readonly Singleton instance = new Singleton();
}  

internal 安全性考虑
internal static .net 2.0语言的新特性
static readonly 内存保护,保证线程安全
posted @ 2006-12-29 15:09  云水浮萍  阅读(1770)  评论(0编辑  收藏  举报