最新评论
Cat Chen 2008-08-04 00:26
最后一个例子应该是这样吧:
class Person
attr_accessor :count
@@count2 = 0
def self.count2
@@count2
end
def self.count2=(value)
@@count2 = value
end
end
这样count2才是和C#代码对应,属于static的。
class Person
attr_accessor :count
@@count2 = 0
def self.count2
@@count2
end
def self.count2=(value)
@@count2 = value
end
end
这样count2才是和C#代码对应,属于static的。

