2017年7月21日

Python 类

摘要: 1、多态 在子类中重写父类的方法,用子类调用该方法,会执行子类重写的方法,用父类的对象调用,会执行父类的方法 class Animal: def foo(self): print("Animal") class Cat(Animal): def foo(self): print("Cat") cla 阅读全文

posted @ 2017-07-21 09:53 7890陈 阅读(178) 评论(0) 推荐(0) 编辑

导航