Skip to content

Commit 4a32f23

Browse files
committed
fixed python that was attributed to java
1 parent 3b67541 commit 4a32f23

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

source/ch2_firstjavaprogram.ptx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,11 @@ System.
490490
</p>
491491

492492
<p>
493-
If we wanted to translate the Java back to Python we would have something like <xref ref="python-hello-world" text="type-global"/> class definition.
493+
If we wanted to translate the Java back to Python we would have something like <xref ref="python-static-method" text="type-global"/> class definition.
494494
</p>
495495

496-
<listing xml:id="java-staticmethod">
497-
<program language="java">
496+
<listing xml:id="python-static-method">
497+
<program language="python">
498498
<code>
499499
class Hello(object):
500500
@staticmethod
@@ -506,12 +506,12 @@ class Hello(object):
506506

507507
<p>
508508
Notice that we used the decorator <c>@staticmethod</c> to tell the Python interpreter that <c>main</c> is going to be a static method.
509-
The impact of this is that we don&#x2019;t have to, indeed we should not, use <c>self</c> as the first parameter of the main method! Using this definition we can call the main method in a Python session like this:
509+
The impact of this is that we don&#x2019;t have to, indeed we should not, use <c>self</c> as the first parameter of the main method! Using this definition we can call the main method in a Python session like <xref ref="python-static-method-run" text="type-global"/>.
510510
</p>
511511

512512

513-
<listing xml:id="java-static-method">
514-
<program language="java">
513+
<listing xml:id="python-static-method-run">
514+
<program language="python">
515515
<code>
516516
&gt;&gt;&gt; Hello.main("")
517517
Hello World!

0 commit comments

Comments
 (0)