下列范例示范使用基底类别初始设定式。
The following example demonstrates using the base class initializer.
在衍生类别中覆写时,会传回指定之方法的初始设定式。
When overridden in a derived class, returns an initializer for the specified method.
当您使用物件初始设定式来建立具名型别的执行个体时,会呼叫类别的预设建构函式,接著按照您指定的顺序初始化指定的成员。
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.
它无法在基底类别的初始设定式清单中使用。
若要初始化类别,所有的静态区块和静态栏位初始设定式是以它们出现在类别主体中的顺序来执行。
To initialize the class, all the static blocks and static field initializers are executed in the order in which they appear in the class body.
若要初始化类别,所有的静态区块和静态栏位初始设定式是以它们出现在类别主体中的顺序来执行。
To initialize the class, all the static blocks and static field initializers are executed in the order in which they appear in the class body.
应用推荐