title: Java hashCode, equals error i don't understand
body: <p>I have to override hashCode method in my class but i have this error:</p>
  <p>cannot find symbol:  symbol:   variable Objects</p>
  <p>Also, how can i add string inventor comparison in equals
  my code :</p>
  <pre><code>public abstract class ThingMadeByHuman {
  
      protected String inventor;
      protected int yearOfInvention;
  
      @Override
      public boolean equals(Object o) {
          if (this == o) {
              return true;
          }
          if (o != null || getClass() != o.getClass()) {
              return false;
          }
          ThingMadeByHuman thingMadeByHuman = (ThingMadeByHuman) o;
          return Integer.compare(thingMadeByHuman.yearOfInvention, yearOfInvention) == 0;
      }
  
      @Override
      public String toString() {
          return &quot;ThingMadeByHuman: inventor:&quot; + this.inventor + &quot; yearOfInvention:&quot; + this.yearOfInvention;
      }
  
      @Override
      public int hashCode() {
          return Objects.hash(yearOfInvention) + super.hashCode();
      }
  
      public ThingMadeByHuman(String inventor, int yearOfInvention) {
          this.yearOfInvention = yearOfInvention;
          this.inventor = inventor;
      }
  }
  </code></pre>