Skip to content

Commit a22d219

Browse files
authored
Update Rational.java (exercism#2353)
Rational.hashCode() accidentally used the same field twice instead of numerator and denumerator.
1 parent 85b86d1 commit a22d219

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

exercises/practice/rational-numbers/src/main/java/Rational.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ public boolean equals(Object obj) {
5959

6060
@Override
6161
public int hashCode() {
62-
return Objects.hash(this.getDenominator(), this.getDenominator());
62+
return Objects.hash(this.getNumerator(), this.getDenominator());
6363
}
6464
}

0 commit comments

Comments
 (0)