python---class(二):派生类覆盖基类中的方法

一、子类覆盖基类的方法,即:子类的方法名称与基类的方法重名,此时若想调用基类的该方法,需要:基类名.方法 代码注解: 代码: #!/usr/bin/env python #-*-coding:utf-8 -*- class Employee: '''Class to represent an employee''' def __init__(self,first,last):
相关文章
相关标签/搜索