title: Difference between initialization at declaration and initialization in constructor
body: <p>What is the difference between the following two, and which is more preferable??</p>
  
  <pre><code>public class foo {
  
      int i = 2;
  
  }
  
  public class foo {
  
    int i;
      foo() {
  
          i = 2;
  
      }
  }
  </code></pre>