静态构造方法在类第一次实例化的时候执行异常
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 }
静态构造方法在类第一次实例化的时候执行异常
本文来自博客园,作者:吖吼、,转载请注明原文链接:https://www.cnblogs.com/YaHouSir/articles/17374051.html

浙公网安备 33010602011771号