静态构造方法在类第一次实例化的时候执行异常

 1 using System;
 2 using System.Collections.Generic;
 3 using System.Linq;
 4 using System.Text;
 5 using YaHou.Extend;
 6 
 7 namespace YaHou
 8 { 
 9   class Program
10     {  
11         static void Main(string[] args)
12         {
13             Class1 o1 = new Class1();
14             Class1 o2 = new Class1();
15         }
16     }
17     class Class1
18     {
19         internal static int count = 0;
20         static Class1()
21         {
22             count++;
23         }
24         public Class1()
25         {
26             count++;
27         }
28     }
29 
30 
31 }
静态构造方法在类第一次实例化的时候执行异常

静态构造方法在类第一次实例化的时候执行异常

posted @ 2023-05-05 14:23  吖吼、  阅读(12)  评论(0)    收藏  举报