title: Explanation of output
body: <p>My program</p>
  
  <pre><code>class Building {
  Building() {
      System.out.print("b ");
  }
  
  Building(String name) {
      this();
      System.out.print("bn " + name);
  }
  };
  
  public class House extends Building {
  House() {
      System.out.print("h "); // this is line# 1
  }
  
  House(String name) {
      this(); // This is line#2
      System.out.print("hn " + name);
  }
  
  public static void main(String[] args) {
      new House("x ");
  }
  }
  </code></pre>
  
  <p>We know that compiler will write a call to <code>super()</code> as the first line in the child class's constructor. Therefore should not the output be:</p>
  
  <p><code>b</code> (call from compiler written call to super(), before line#2</p>
  
  <p><code>b</code> (again from compiler written call to super(),before line#1 )</p>
  
  <pre><code>h hn x
  </code></pre>
  
  <p>But the output is </p>
  
  <pre><code>b h hn x
  </code></pre>
  
  <p>Why is that? </p>