package itcast.day07; /* * 假如我们在开发一个系统时需要对员工进行建模,员工包含 3 个属性: * 姓名、工号以及工资。经理也是员工,除了含有员工的属性外,另为还有一个 * 奖金属性。请使用继承的思想设计出员工类和经理类。要求类中提供必要的方 * 法进行属性访问。 * 员工类:name id pay * 经理类:继承了员工,并有自己特有的bonus。 */ abstract class Pro { public String name; public String id; public double pay; public abstract void work(); } class Employee extends Pro { public Employee(String name, String id, double pay) { this.name = name; this.id = id; this.pay = pay; } @Override public void work() { // TODO Auto-generated method stub } } class Manager extends Pro { private int bonus; public Manager(String name, String id, double pay, int bouns) { this.name = name; this.id = id; this.pay = pay; this.bonus = bouns; } @Override public void work() { // TODO Auto-generated method stub } } public class AbstractTest { public static void main(String[] args) { } }