diff --git a/source/ch6_definingclasses.ptx b/source/ch6_definingclasses.ptx index c1b2d6f..3450de8 100644 --- a/source/ch6_definingclasses.ptx +++ b/source/ch6_definingclasses.ptx @@ -766,11 +766,11 @@ public void test(Number a, Number b) {
The
int compareTo(T o)
Compares this object with the specified object for order. Returns a
@@ -782,27 +782,29 @@ iff y.compareTo(x) throws an exception.)
...
- To make our
public class Fraction extends Number implements Comparable<Fraction> {
...
}
The specification
public int compareTo(Fraction other) {
Integer num1 = this.numerator * other.getDenominator();
@@ -811,8 +813,11 @@ public int compareTo(Fraction other) {
}