擅长:python、mysql、java
<p>您只是引用了这些方法,实际上并没有调用它们</p>
<p>请改为:</p>
<pre><code>parentOBJ.helloWorld()
childOBJ.helloWorld()
childOBJ.helloWorld2()
</code></pre>
<p>调用函数时,必须执行<code>method_name(arguments)</code></p>
<p>因此,如果我有一个名为<code>def hello(a, b):</code>的方法,我实际上也需要将参数传递给函数,如下:<code>hello('hello', 'world')</code></p>
<h3>示例</h3>
<pre><code>>>> def hello():
... print 'hello'
...
>>> hello
<function hello at 0x2340bc>
>>> hello()
hello
</code></pre>
<p>希望有帮助</p>