Skip to content

Commit 269c931

Browse files
committed
added idx tags
1 parent 00a013c commit 269c931

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

source/ch6_definingclasses.ptx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@
6262
</p>
6363

6464
<p>
65-
<xref ref="python-fracion-class1" text="type-global"/> is a mostly complete implementation of a Fraction class in Python that we will refer to throughout this section.
65+
<xref ref="python-fraction-class-all" text="type-global"/> is a mostly complete implementation of a Fraction class in Python that we will refer to throughout this section.
6666
</p>
6767

68-
<listing xml:id="python-fracion-class1">
68+
<listing xml:id="python-fraction-class-all">
6969
<program interactive="activecode" language="python">
7070
<code>
7171
class Fraction:
@@ -134,10 +134,10 @@
134134
</p>
135135

136136
<p>
137-
The declarations of instance variables can come at the beginning of the class definition or the end. Cay Horstman, author of <url href="https://horstmann.com/corejava/index.html" visual="https://horstmann.com/corejava/index.html">the &#x201C;Core Java&#x201D; books</url> puts the declarations at the end of the class. I like them at the very beginning so you see the variables that are declared before you begin looking at the code that uses them. With that in mind <xref ref="java-fraction-class1" text="type-global"/> shows the first part of the Fraction class definition.
137+
The declarations of instance variables can come at the beginning of the class definition or the end. Cay Horstman, author of <url href="https://horstmann.com/corejava/index.html" visual="https://horstmann.com/corejava/index.html">the &#x201C;Core Java&#x201D; books</url> puts the declarations at the end of the class. I like them at the very beginning so you see the variables that are declared before you begin looking at the code that uses them. With that in mind <xref ref="java-fraction-class-start" text="type-global"/> shows the first part of the Fraction class definition.
138138
</p>
139139

140-
<listing xml:id="java-fraction-class1">
140+
<listing xml:id="java-fraction-class-start">
141141
<program interactive="activecode" language="java">
142142
<code>
143143
public class Fraction {
@@ -149,6 +149,7 @@
149149
</listing>
150150

151151
<p>
152+
<idx>private</idx>
152153
Notice that we have declared the numerator and denominator to be <term>private</term>.
153154
This means that the compiler will generate an error if another method tries to write code like <xref ref="java-private" text="type-global"/>.
154155
</p>

0 commit comments

Comments
 (0)