|
Insert code into the equalsImpl() method in order to provide a correct implementation of the equals() method.
public class Pair {
int a, b;
public Pair(int a, int b) {
this.a = a;
this.b = b;
}
public boolean equals(Object o) {
return (this == o) || (o instanceof Pair) && equalsImpl((Pair) o);
}
private boolean equalsImpl(Pair o) {
// ... PROVIDE IMPLEMENTATION HERE ...
}
}
Select the three correct answers.
return a == o.a || b == o.b; return false; return a >= o.a; return a == o.a; return a == o.a && b == o.b;
|