如果我有程序如下: C# code ? 1 2 3 4 5 6 7 public class My { public bool b; public int i; } Trace.WriteLine(new My().b.ToString()); Trace.WriteLine(new My().i.ToString()); 那么Trace的打印结果是False, 0而且我的VS2013的debug/release版的结果
https://stackoverflow.com/questions/185844/how-to-initialize-private-static-members-in-c https://stackoverflow.com/questions/1197106/static-constructors-in-c-i-need-to-initialize-private-static-objects One idiom was proposed at: https://stackoverflow