Solve the first exercise

This commit is contained in:
Manuel Thalmann 2022-10-04 14:36:37 +02:00
parent 32799964b9
commit 29adffee18

View file

@ -48,20 +48,23 @@ public class Competitor implements Comparable<Competitor> {
@Override @Override
public int compareTo(Competitor o) { public int compareTo(Competitor o) {
// TODO Implement return Long.compare(parseTime(getTime()), parseTime(o.getTime()));
return 0;
} }
@Override @Override
public boolean equals (Object o) { public boolean equals (Object o) {
// TODO Implement if (o instanceof Competitor) {
Competitor c = (Competitor)o;
return compareTo(c) == 0;
}
else {
return false; return false;
} }
}
@Override @Override
public int hashCode() { public int hashCode() {
// TODO Implement return (getTime().hashCode() + getName().hashCode()) * rank;
return 0;
} }
} }