title: Comparing two Date objects with Boolean Class method
body: <p>I am being asked to use the Boolean Class method to compare the year, month, and day of 2 Date objects. I have searched everywhere and can't get more info on how to do this I've always used the equals method in the Date class not the Boolean class. This is what I have so far but it gives me an error message.</p>
  
  <pre><code>public Boolean equals(Object obj) {        
      Date otherDate = (Date)obj;    
      return year == otherDate.year &amp;&amp; month == otherDate.month &amp;&amp; day otherDate.day;    
  }
  </code></pre>
  
  <p>This is the error message:</p>
  
  <blockquote>
    <p>'equals(Object)' in 'Date' clashes with 'equals(Object)' in 'java.lang.Object'; attempting to use incompatible return type</p>
  </blockquote>