您的位置:首页 > 其它

Private Constructor and Singleton design pattern

2007-11-07 10:47 225 查看
public class Singleton

{

static readonly Singleton instance = new Singleton();

static Singleton() //Private Constructor to make sure it cannot be instantiated out of the class bounds.

{

}

public static Singleton Instance

{

get { return instance}

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: