class Parent def test return end end class Child < Parent def test super p "HOW IS THIS POSSIBLE?!" end end c = Child.new c.test
我虽然这样,由于Parent类的测试方法立即使用return语句,所以不可能打印Child类的行.但它确实印刷了.这是为什么?
Ruby 1.8.7,Mac OSX.