title: Why this statement comes to output?
body: <p>I have a question about this code:</p>
  <pre class="lang-cpp prettyprint-override"><code>class A
  {
  public:
      A(){cout&lt;&lt;&quot;A no parameter &quot;;}
      A(string s){cout&lt;&lt;&quot;A string parameter&quot;;}
      A(A &amp;a){cout&lt;&lt;&quot;A object A parameter&quot;;}
      
  };
  
  class B:public A
  {
  public:
      B(){cout&lt;&lt;&quot;B no parameters&quot;;}
      B(string s){cout&lt;&lt; &quot;B strig parameter&quot;;}
      B(int s){cout&lt;&lt;&quot;B int parameter&quot;;}
      
  };
  
  
  int main() {
   
  
      A a2(&quot;Test&quot;);
      B b1(10);
      B b2(b1);
  
      
      return 0;
  }
  </code></pre>
  <p>When I run this code, I get this result:</p>
  <pre class="lang-none prettyprint-override"><code>A string parameterA no parameter B int parameterA object A parameterProgram ended with exit code: 0&quot;
  </code></pre>
  <p>I am actually not sure why the statement <code>A no parameter</code> shows up, even though I did not assign the statement about it.</p>
  <p>I am studying coding for now, so I am glad if you explain this.</p>