答案 0 :(得分:1)
尝试为private int x, y;
@Override
public boolean equals(Object o) {
if (o == this) return true;
if (!(o instanceof Planquadrat)) {
return false;
}
Planquadrat p = (Planquadrat) o;
return p.x == x &&
p.y == y;
}
@Override
public int hashCode() {
int hash = 7;
hash = 31 * hash + this.x;
hash = 31 * hash + this.y;
return hash;
}
标记设置white-space
css属性为pre-wrap
,即
/ HTML /
Content here
/ * CSS * /
pre
这将在必要时保留换行符和换行文本。您可以详细了解pre { white-space: pre-wrap; }
css属性here