How does initializing inherited members inside base class constructor reduce the calls to…?
<p>I’ve read that instead of initializing inherited members ( <code>_c1</code> in our example ) inside derived constructor:</p>

<pre><code>class A
{
    public int _c;
}

class B:A
{
    public B(int c)
    {
        _c = c;
    }
}
</code></pre>

<p>we should initialize them inside base class constructor, since that way we reduce the calls to inherited members ( <code>_c</code> ):</p>

<pre><code>class A
{
    public A(int c)
    {
        _c = c;
    }
    public int _c;
}

class B:A
{
    public B(int c)
        : base(c)
    {


    }
}
</code></pre>

<p>If <code>_c</code> field is initialized inside base constructor, the order of initialization is the following:  </p>

<p>1) First the field initializers of derived class <code>B</code> are called <br>
2) Then field initializers of base class <code>A</code> are called (at this point <code>_c</code> is set to value <code>0</code>)<br>
3) <code>B’s</code> constructor is called, which in turn calls <code>A’s</code> custom constructor<br>
4) <code>_c</code> field gets set to value of a parameter <code>c</code> ( inside <code>A’s</code> custom constructor )<br> 
5) Once <code>A’s</code> custom constructor returns, <code>B’s</code> constructor executes its code.</p>

<p>If <code>_c</code>  field is initialized inside <code>B's</code> constructor, the order of initialization is the following:  </p>

<p>1) First the field initializers of a derived class <code>B</code> are called <br>
2) Then field initializers of a base class <code>A</code> are called(at this point <code>_c</code> is set to value <code>0</code>) <br>
3) <code>B’s</code> constructor is called, which in turn calls <code>A’s</code> default  constructor <br>
4) Once <code>A’s</code> custom constructor returns, <code>B’s</code> constructor sets <code>_c</code> field to a value of parameter <code>c</code></p>

<p>As far as I can tell, in both cases was <code>_c</code> called two  times, so how exactly did we reduce calls to inherited member <code>_c</code>?</p>

<p>thanx</p>
