public class Employee{ /* *显示参数为Employee,其结果没有覆盖Object的equals方法,而是定义了一个新的方法 */ public boolean equals(Employee other){ return name.equals(other.name)&&salary==other.salary&&hireDay.equals(other.hireDay); } }
public class Employee{ /* *显示参数为Employee,其结果没有覆盖Object的equals方法,而是定义了一个新的方法 */ public boolean equals(Employee other){ return name.equals(other.name)&&salary==other.salary&&hireDay.equals(other.hireDay); } }
转载于:https://www.cnblogs.com/sdgtxuyong/p/6572511.html