当您使用物件初始设定式来建立具名型别的执行个体时,会呼叫类别的预设建构函式,接著按照您指定的顺序初始化指定的成员。
When you use an object initializer to create an instance of a named type, the default constructor for the class is called, followed by initialization of designated members in the order you specify.
当阵列在建构函式的成员初始设定清单中时,阵列元素将预设为初始化。
When an array is in a constructor's member initialization list, the elements of the array will be default initialized.
如果类别没有任何的建构函式,则会自动产生预设建构函式,而预设值会用于初始化栏位。
If a class does not have a constructor, a default constructor is automatically generated and default values are used to initialize the object fields.
应用推荐