title: How does the constructor work while initializing an object?
body: <p>The output of this code is 7 20. </p>
  
  <p>Why does 7 print first and 20 is printed after that?  </p>
  
  <pre><code>public class Television 
  {
      private int channel = setChannel(7);
      public Television(int channel) 
      {
          this.channel = channel;
          System.out.print(channel +"");
      }
  
      public int setChannel(int channel) 
      {
          this.channel = channel;
          System.out.print(channel + "");
          return channel;
      }
  
      public static void main(String args[])
      {
          new Television(20);
      }
  }
  </code></pre>