COPY@Override
public boolean equals(Object obj) {//1.是否为同一对象if (this==obj) {return true;}//2.判断是否为空if (obj==null) {return false;}//3.判断是否是Student类型if (obj instanceof Student) {Student student=(Student) obj;//4.比较属性if(this.name.equals(student.getName())&&this.age==student.age) {return true;}}//不满足,返回falsereturn false;
}