面试题2 单例

 1 public sealed class Singleton
 2 {
 3     private Singleton()
 4     {
 5 
 6     }
 7 
 8     private static Singleton instance = new Singleton();
 9 
10     public static Singleton Instance
11     {
12         get
13         {
14             return instance;
15         }
16     }
17 };

 

posted @ 2016-04-04 12:26  早杰  阅读(98)  评论(0编辑  收藏  举报