"i can run and fly"。super方法。" />

super方法

【super方法】super关键字是用做类的继承,主要作用是调用父类的同名方法。
```
class Car
def ability
"i can run"
end
end
```
class Plane < Car
def ability
super << "and fly"
end
end


puts Plane.new.ability
#=> "i can run and fly"

    推荐阅读