Skip to content

Commit d15068b

Browse files
committed
added comments to code
1 parent 7a3c89c commit d15068b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

source/ch6_definingclasses.ptx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public void setDenominator(Integer denominator) {
207207
<program xml:id="java-fraction-constructor" language="java">
208208
<code>
209209
public Fraction(Integer top, Integer bottom) {
210-
num = top;
210+
num = top; // notice the use of num instead of top
211211
den = bottom;
212212
}
213213
</code>
@@ -228,7 +228,7 @@ public Fraction(Integer top, Integer bottom) {
228228
<program xml:id="java-fraction-class-this" language="java">
229229
<code>
230230
public Fraction(Integer num, Integer den) {
231-
this.num = num;
231+
this.num = num; // notice how we use this.num instead of num
232232
this.den = den;
233233
}
234234
</code>

0 commit comments

Comments
 (0)