title: Java equals for a Class. Is == same as .equals
body: <p>Can we do a <code>==</code> on a <code>Class</code> variable instead of <code>equals</code> and expect the same result?</p>
  
  <p>For example:</p>
  
  <pre><code>Class clazz = xyz;
  </code></pre>
  
  <p><strong>Case A:</strong></p>
  
  <pre><code>if(clazz == Date.class) {
  // do something
  }
  </code></pre>
  
  <p><strong>Case B:</strong></p>
  
  <pre><code>if(Date.class.equals(clazz)) {
  // do something
  }
  </code></pre>
  
  <p>Are Case A and Case B functionally same?</p>