这几只是简单的举了一个id,id为自动增长,在实际开发中有什么意思和重要性,要对id进行比较Override
private int z;//自动增长
public int getZ() {
return z;
}
public void setZ(int z) {
this.z = z;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + z;
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ReflectPoint other = (ReflectPoint) obj;
if (z != other.z)
return false;
return true;
} |