C# 单例模式

这里记录一种最简单的写法:

public class Singleton
{
    private Singleton(){}
    public static readonly Singleton Instance = new Singleton();
}  
posted @ 2017-09-05 12:31  taadis  阅读(72)  评论(0编辑  收藏  举报