2008年6月8日 星期日

self & method

when there is a method ending with =,  such as test=, 
and there is another method  run
In the definition of run, there are two conditions:
(1)  test=3
      this means test is a local variable
(2) self.test=2
      this will call test method with parameter 2

Hence, when calling the method ending with = in the method definition, we can not omit self

沒有留言: