- 参考 - P184
public boolean equals(Object otherObject) {// a quick test to see if the objects are identicalif (this == otherObject) return true;// must return false if the explicit parameter is nullif (otherObject == null) return null;// if the classes don`t match, they can`t be equalvar other = (Employee) otherObject;// test whether the fields have identical valuesreturn Objects.equals(name, other.name)&& salary == other.salary && Object.equals(hireDay, other.hireDay);
}