编写Emp(eno,ename,esex)类,要求重写equals方法结果为true
public class Emp{
private Integer eno;
private String ename;
private Integer esex;
public Emp(){}
// get set 方法略
public int hashcode(){ return this.eno;)
public boolean equals(Object obj){ if(obj.hashcode().equals(this.hashcode())){return true;} else { return false;}}
}
赞0
踩0