title: Why do we write Synchronized(ClassName.class)
body: <p>I have a question in singleton pattern.
  In singleton pattern we write </p>
  
  <pre><code>synchronized(ClassName.class){
  
       // other code goes here
  
  }
  </code></pre>
  
  <p>What is the purpose of writing <code>ClassName.class</code>?</p>