C# base() constructor order [duplicate]
问题 This question already has answers here : Closed 11 years ago . Possible Duplicate: C# constructor execution order class Foo { public int abc; Foo() { abc = 3; } } class Bar : Foo { Bar() : base() { abc = 2; } } In the example above, when an object of Bar is created, what will be the value of BarObject.abc? Is the base constructor called first, or is Bar() run, /then/ the base() constructor? 回答1: It'll be 2. Constructors run in order from base class first to inherited class last. Note that