title: C# two classes with static members referring to each other
body: <p>I wonder why this code doesn't end up in endless recursion. I guess it's connected to the automatic initialization of static members to default values, but can someone tell me <em>"step by step"</em> how does 'a' get the value of 2 and 'b' of 1?      </p>
  
  <pre><code>public class A
  {
      public static int a = B.b + 1;
  }
  public class B
  {
      public static int b = A.a + 1;
  }
  
  static void Main(string[] args)
  {
      Console.WriteLine("A.a={0}, B.b={1}", A.a, B.b); //A.a=2, B.b=1
      Console.Read();
  }
  </code></pre>