class A
def bcd
puts "bcd"
end
end
ta = A.new
ta.bcd
class A
def cdf
puts "cdf"
end
end
a = A.new
a.cdf
a.bcd
ta.cdf
重新定义只会增加原来类的内容,并不会覆盖。
def bcd
puts "bcd"
end
end
ta = A.new
ta.bcd
class A
def cdf
puts "cdf"
end
end
a = A.new
a.cdf
a.bcd
ta.cdf
重新定义只会增加原来类的内容,并不会覆盖。