title: how to compare two objects/references in java?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3950439/equals-method-for-objects">Equals method for objects</a>  </p>
  </blockquote>
  
  
  
  <p>i have below code. </p>
  
  <pre><code>public class SomeClass{ 
  OtherClass clas = new OtherClass();  
  OtherClass some; 
  some=this; 
  if(some != this) {
      s.y.s.o("true");
  }
  </code></pre>
  
  <p>my question is which one is correct?<br>
   some != this or some.equals(this) ?</p>