title: JAVA, public static variables initialization
body: <pre><code>/* ---------------------- classes --------------- */
  
  public class A {
    public static String str = "compile";
        public A() {
    }
  }
  
  public class B {
    public static String str = A.str;
  
    public B() {
    }
  }
  
  /* ----------------------------------------------- */
  
  /* ------------ main class --------------------- */
  
  public class C {
  
    public static void main(String[] args) {
      A.str = "runtime";
      A a = new A();
      B b = new B();
  
      // comment at the first, and comment this out next time
      //A.str = "runtime2";
  
      System.out.println(A.str);
      System.out.println(a.str);
      System.out.println(B.str);
      System.out.println(b.str);
    }
  }
  
  /* --------------------------------------------- */
  </code></pre>
  
  <p>results is like this....</p>
  
  <ol>
  <li><p>with comment :
  runtime
  runtime
  runtime
  runtime</p></li>
  <li><p>without comment :
  runtime2
  runtime2
  runtime
  runtime</p></li>
  </ol>
  
  <p>I understand in A's case, 
  but i don't in B's case.
  Would you please explain about this?</p>