title: Overriding an Equals method in Java
body: <p>Basically, I have to override for the equals method of object Employee.</p>
  
  <p>I tried </p>
  
  <pre><code>public boolean equals( Object b ){
     if (this == b) return true; 
     if ( ! (b instanceof Employee) )
        return false;
     final other=(Employee)b;
     return getID()==other.getID();
  }
  </code></pre>
  
  <p>but received an Error:</p>
  
  <pre><code>Employee.java:28: error: &lt;identifier&gt; expected 
  
     final other=(Employee)b; 
  </code></pre>
  
  <pre><code>public boolean equals( Object b ) 
  { 
    if ( ! (b instanceof Employee) ) 
      return false; 
  </code></pre>