1.重写equals
@Override public boolean equals(Object c) { if (this == c) { return true; } if (c == null || this.getClass() != c.getClass()) return false; Book2 c1 = (Book2) c; return color == c1.color && type == c1.type; }
1.重写equals
@Override public boolean equals(Object c) { if (this == c) { return true; } if (c == null || this.getClass() != c.getClass()) return false; Book2 c1 = (Book2) c; return color == c1.color && type == c1.type; }