建立测试类main方法创建学生类的对象姓名:小明、年龄:17、性别:男、学号:NO13、成绩:82并调用eat和show方法;创建工人类的对象姓名:老明、年龄用java
public class Test { public static void main(String[] args) { Student student = new Student("小明", 17, "男", "NO13", 82); student.eat(); student.show();
Worker worker = new Worker("老明", 30, "男", "001", 5000);
worker.eat();
worker.show();
}
}
原文地址: https://www.cveoy.top/t/topic/fNfi 著作权归作者所有。请勿转载和采集!