title: public boolean equals(Object other)
body: <p>This is for a Fraction program. I have private ints num and den, Fraction, and FractionInterface - the standard homework problem. I have done pretty much everything and now have been stuck for a few hours on the equals method. Since other is an Object, I can't equate it to Fraction. Here's what I have:</p>
  
  <pre class="lang-java prettyprint-override"><code>public boolean equals(Object other){        
       if (other == this){
           return true;
       } else {
           return false;
       }
  }
  </code></pre>
  
  <p>This compiles but it gives incorrect results:</p>
  
  <pre><code>1/2 eq 1/2 = true
  1/2 eq 1/2 = true
  1/2 eq 1/2 = false
  1/2 eq 1/2 = false
  </code></pre>
  
  <p>If I try other == Fraction, it doesn't compile. Thanks for any help!</p>