在继承的关系中,”子类就是父类“。也就是说,子类可以被当作父类看待列如:父类是员工,子类是讲师,那么”讲师就是一个员工“。定义父类的格式:(一个普通的类定义)public class 父类名称{ //...}定义一个子类格式:public class extends 父类名称{ //...}