title: Are there two kinds of equals() method
body: <p>There are two kinds equals methods?</p>
  
  <pre><code>public boolean equals(Bigram b) {
      return b.first == first &amp;&amp; b.second == second;
      }
  
  @Override public boolean equals(Object o) {
      if (!(o instanceof Bigram))
          return false;
      Bigram b = (Bigram) o;
      return b.first == first &amp;&amp; b.second == second;
  }
  </code></pre>
  
  <p>compare with the 2 methods,when we want to override the <strong>equal method</strong>,why we need to  define an equals method whose parameter is of <strong>type Object</strong>!<br></p>