diff --git a/source/ch6_definingclasses.ptx b/source/ch6_definingclasses.ptx index 252ec9b..07b6931 100644 --- a/source/ch6_definingclasses.ptx +++ b/source/ch6_definingclasses.ptx @@ -196,6 +196,7 @@ public void setDenominator(Integer denominator) {
+
public Fraction(Integer top, Integer bottom) {
- num = top;
+ num = top; // notice the use of num instead of top
den = bottom;
}
@@ -228,7 +229,7 @@ public Fraction(Integer top, Integer bottom) {
public Fraction(Integer num, Integer den) {
- this.num = num;
+ this.num = num; // notice how we use this.num instead of num
this.den = den;
}