Skip to content

Commit 8c74405

Browse files
committed
added idx and term tags
1 parent e23d4f9 commit 8c74405

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

source/ch6_definingclasses.ptx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ Fraction@6ff3c5b5
488488
<p>
489489
<idx><c>toString</c></idx>
490490
In Java, the equivalent of <c>__str__</c> is the <c>toString</c> method.
491-
Every object in Java already has a <c>toString</c> method defined for it because every class in Java automatically inherits from the <c>Object</c> class.
491+
Every object in Java already has a <term> <c>toString</c> method</term> defined for it because every class in Java automatically inherits from the <c>Object</c> class.
492492
The <c>Object</c> class provides default implementations for the following methods.
493493
</p>
494494

@@ -567,6 +567,7 @@ public String toString() {
567567
</listing>
568568

569569
<p>
570+
<idx><c>equals</c></idx>
570571
The other important class for us to implement from the list of methods inherited from <c>Object</c> is the <c>equals</c> method.
571572
In Java, when two objects are compared using the <c>==</c> operator they are tested to see if they are exactly the same object (that is, do the two objects occupy the same exact space in the computer&#x2019;s memory?).
572573
This is also the default behavior of the <c>equals</c> method provided by <c>Object</c>.
@@ -651,7 +652,7 @@ public class Fraction extends Number {
651652

652653
<p>
653654
<idx><c>extends</c></idx>
654-
The keyword <c>extends</c> tells the compiler that the class <c>Fraction</c> extends, or adds new functionality to the <c>Number</c> class.
655+
The keyword <term><c>extends</c></term> tells the compiler that the class <c>Fraction</c> extends, or adds new functionality to the <c>Number</c> class.
655656
A child class always extends its parent.
656657
</p>
657658

0 commit comments

Comments
 (0)