title: Java: compare object values
body: <p>I am trying to compare the value of 2 instances of x inside an iterator.</p>
  
  <p>x is a reference type containing its own data members. I am trying to compare one instance of x against another to determine if the values inside each are the same.</p>
  
  <p>if (x.equals(x))</p>
  
  <p>keeps evaluating to true when actually the value of each instance of x is different.</p>
  
  <p>Cheers.</p>