class EqualsDemo {
private int state;
public EqualsDemo (int state){
this.state = state;
}
public boolean equals(Object other){
int thisState = this.state;
int otherState = ((EqualsDemo) other).state;
if (other instanceof EqualsDemo)
return thisState == otherState;
else return false;
}
}