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