title: Java initialising a static field to itself
body: <p>This code compiles (using Java 8), giving the warning <code>The assignment to variable value has no effect</code>:</p>
  
  <pre><code>package test;
  
  public class Test {
      private static int value;
  
      static {
          value = Test.value;
      }
  
      public static void main(String[] args) {
          System.out.println(value);
      }
  }
  </code></pre>
  
  <p>The program outputs <code>0</code> as expected. But why does the compiler allow this, what is the use case?</p>