第二种情况是,类型具有一个用于静态字段的初始值设定项,在这种情况下,编译器会在后台添加类型构造函数。
The second scenario is when a type has a initializer for a static field, in which case the compiler adds a type constructor behind the scenes.
此程序还演示了静态字段初始值设定项如何在显式类型构造函数中的代码之前执行。
This program also demonstrates how static field initializers execute before the code inside an explicit type constructor.
正如您在前面看到的那样,静态字段初始值设定项的代码在隐式类型构造函数的内部执行。
As you saw earlier, the code for a static field initializer executes inside an implicit type constructor.
应用推荐