title: java "void" and "non void" constructor
body: <p>I wrote this simple class in java just for testing some of its features.</p>
  
  <pre><code>public class class1 {
      public static Integer value=0;
      public class1() {
         da();
      }
      public int da() {
          class1.value=class1.value+1;
          return 5;
      }
      public static void main(String[] args) {
         class1 h  = new class1();
         class1 h2 = new class1();
         System.out.println(class1.value);
      }
  }
  </code></pre>
  
  <p>The output is:</p>
  
  <blockquote>
    <p>2</p>
  </blockquote>
  
  <p>But in this code:</p>
  
  <pre><code>public class class1 {
      public static Integer value=0;
      public void class1() {
          da();
      }
      public int da() {
          class1.value=class1.value+1;
          return 5;
      }
      public static void main(String[] args) {
          class1 h  = new class1();
          class1 h2 = new class1();
          System.out.println(class1.value);
      }
  }
  </code></pre>
  
  <p>The output of this code is:</p>
  
  <blockquote>
    <p>0</p>
  </blockquote>
  
  <p>So why doesn't, when I use <code>void</code> in the constructor method declaration, the static field of the class doesn't change any more?</p>