title: Is the Class object A created when the JVM loads class A, or when I call A.class?
body: <p>As I know, every class has a <code>Class</code> object. There is one case when I use synchronize, for example:</p>
  
  <pre><code>public class A {
      public static void main(String... args){
          synchronize(A.class){
              //do something...
          }
      }
  }
  </code></pre>
  
  <p>This will lock <code>A</code>'s <code>Class</code> object, right? When is this <code>Class</code> object created? Is it created when the JVM loads the <code>A</code> class or when I call <code>A.class</code>? I can't find detail in JLS, could someone please provide the link about it?</p>