To be or not to be.That is a question!

---源于莎士比亚的《哈姆雷特》

导航

2013年7月30日 #

ruby 方法重载

摘要: class MyClass def sayHello return "hello from MyClass" end def sayGoodbye return "Goodbye from MyClass" endendclass MyOtherClass < MyClass def sayHello return "Hello from MyOtherClass" end def sayGoodbye return super << "and also from MyOtherClass... 阅读全文

posted @ 2013-07-30 15:53 Ijavascript 阅读(452) 评论(0) 推荐(0) 编辑