надеюсь, это не заставляет меня казаться идиотом, но я, похоже, не справляюсь с простым упражнением, где мне нужно сравнить два объекта, чтобы проверить, равны ли они, мой Java класс ниже вместе с ошибкой сообщение, которое я получаю от упражнения. Кто-нибудь знает, как это решить? Заранее спасибо.
import java.util.Objects;
public class Person {
private String name;
private SimpleDate birthday;
private int height;
private int weight;
public Person(String name, SimpleDate birthday, int height, int weight) {
this.name = name;
this.birthday = birthday;
this.height = height;
this.weight = weight;
hashCode();
}
public String getName(){
return this.name;
}
public SimpleDate getBirthday(){
return this.birthday;
}
public Integer getHeight(){
return this.height;
}
public Integer getWeight(){
return this.weight;
}
// implement an equals method here for checking the equality of objects
@Override
public boolean equals(Object compared){
return this==compared;
}
}
Сообщение об ошибке