title: Can a Java static initializer call a static method?
body: <p>Can I call a static method from a static initializer in Java? Is the following valid and guaranteed to work as per the Java specification?</p>
  
  <pre><code>public class Foo {
  
    private final static int bar;
  
    private static int generateValue() {
      return 123;
    }
  
    static {
      bar = generateValue();
    }
  
  }
  </code></pre>
  
  <p>What makes me wonder is that I might expect <code>bar</code> to be available inside <code>generateValue()</code>. I know the order of static initializer blocks is important, but I hadn't heard of the order of static method declarations being significant. But are static methods made available before static initializer blocks are executed?</p>